<script module lang="ts">
	import { defineMeta } from "@storybook/addon-svelte-csf";
	import TimeAgo from "./TimeAgo.svelte";

	const recent = "2026-07-28T08:00:00Z";

	const { Story } = defineMeta({
		title: "UI/TimeAgo",
		component: TimeAgo,
		tags: ["autodocs"],
		argTypes: {
			value: { control: "date" },
			variant: {
				control: { type: "inline-radio" },
				options: ["compact", "full"]
			}
		},
		args: { value: recent, variant: "compact" }
	});
</script>

<Story name="Compact relative time" />
<Story name="Full relative time" args={{ variant: "full" }} />
<Story name="Date object input" args={{ value: new Date(recent) }} />
<Story name="Invalid input renders nothing" args={{ value: "not-a-date" }} />
