import type { Meta, StoryObj } from '@storybook/svelte';

import Created from '$lib/components/atoms/Created.svelte';

const meta = {
	title: 'Atoms/Created',
	component: Created,
	tags: ['autodocs'],
	argTypes: {
		created_at: {
			control: 'date',
			description: 'Date of creation'
		},
		created_at_formatted: {
			control: 'text',
			description: 'Localised version of created_at'
		}
	}
} satisfies Meta<Created>;

export default meta;
type Story = StoryObj<typeof meta>;

export const Plain: Story = {
	args: {
		created_at: new Date(),
		created_at_formatted: (function () {
			const locale = 'en-US';
			return new Intl.DateTimeFormat(locale).format(new Date());
		})()
	}
};

export const Missing: Story = {};