This repository has no description
0

Configure Feed

Select the types of activity you want to include in your feed.

core / web / src / lib / components / ui / TimeAgo.stories.svelte
720 B 25 lines
1<script module lang="ts"> 2 import { defineMeta } from "@storybook/addon-svelte-csf"; 3 import TimeAgo from "./TimeAgo.svelte"; 4 5 const recent = "2026-07-28T08:00:00Z"; 6 7 const { Story } = defineMeta({ 8 title: "UI/TimeAgo", 9 component: TimeAgo, 10 tags: ["autodocs"], 11 argTypes: { 12 value: { control: "date" }, 13 variant: { 14 control: { type: "inline-radio" }, 15 options: ["compact", "full"] 16 } 17 }, 18 args: { value: recent, variant: "compact" } 19 }); 20</script> 21 22<Story name="Compact relative time" /> 23<Story name="Full relative time" args={{ variant: "full" }} /> 24<Story name="Date object input" args={{ value: new Date(recent) }} /> 25<Story name="Invalid input renders nothing" args={{ value: "not-a-date" }} />