<script module lang="ts">
	import { defineMeta } from "@storybook/addon-svelte-csf";
	import MockAuthProvider from "$lib/components/testing/MockAuthProvider.svelte";
	import TimelineStarEvent from "./TimelineStarEvent.svelte";
	import type { StarEvent } from "$lib/api/lexicons/types/sh/tangled/feed/getTimeline";

	const owner = { did: "did:plc:3p7ejjxnufohsygt5vbyxb2i", handle: "tangled.org" };

	const event = {
		$type: "sh.tangled.feed.getTimeline#starEvent",
		cid: "bafyreib2",
		uri: "at://did:plc:oky5czdrnfjpqslsw2a5iclo/sh.tangled.feed.star/3l",
		actor: { did: "did:plc:oky5czdrnfjpqslsw2a5iclo", handle: "alice.tngl.sh" },
		repo: {
			did: "did:plc:3p7ejjxnufohsygt5vbyxb2i",
			slug: "core",
			owner,
			createdAt: "2025-06-01T10:30:00Z",
			description: "The knot server, appview, and everything that makes tangled tick.",
			starCount: 42
		}
	} as unknown as StarEvent;

	const { Story } = defineMeta({
		title: "Timeline/TimelineStarEvent",
		component: TimelineStarEvent,
		tags: ["autodocs"],
		args: {
			event,
			eventAt: "2025-06-02T09:00:00Z"
		}
	});
</script>

<Story name="Default">
	{#snippet template(args)}
		<MockAuthProvider>
			<TimelineStarEvent {...args} />
		</MockAuthProvider>
	{/snippet}
</Story>
