import BmsRelativeTime from '@/components/utils/BmsRelativeTime.vue';

export default {
  title: 'Composants/utils/RelativeTime',
  component: BmsRelativeTime,
  argTypes: {
    relativeTo: {
      control: { type: 'number' },
    },
  },
};

const Template = (args) => ({
  components: {
    BmsRelativeTime,
  },
  setup() {
    return { args };
  },
  template: `
    <div style="width: 400px; text-align: center;">
      <p>
        <BmsRelativeTime :relative-to="Date.now()" />
      </p>
      <p>
        <BmsRelativeTime :relative-to="Date.now() - 60000" />
      </p>
      <p>
        <BmsRelativeTime :relative-to="Date.now() - 7200000" />
      </p>
      <p>
        <BmsRelativeTime :relative-to="Date.now() - 86400000" />
      </p>
      <p>
        <BmsRelativeTime :relative-to="1000" />
      </p>
    </div>
  `,
});

export const Primary = Template.bind({});
Primary.args = {};
