<script module lang="ts">
	import { defineMeta } from "@storybook/addon-svelte-csf";
	import IssueCard from "./IssueCard.svelte";
	import type { IssueSummary } from "$lib/components/repo/types";

	const issue: IssueSummary = {
		uri: "at://did:plc:3p7ejjxnufohsygt5vbyxb2i/sh.tangled.repo.issue/3mrkgcxb4m422",
		rkey: "3mrkgcxb4m422",
		title: "Add a full trending repositories view",
		state: "open",
		authorHandle: "joshka.net",
		authorDid: "did:plc:3p7ejjxnufohsygt5vbyxb2i",
		createdAt: "2025-06-01T10:30:00Z",
		commentCount: 3
	};

	const { Story } = defineMeta({
		title: "Repo/Issues/IssueCard",
		component: IssueCard,
		tags: ["autodocs"],
		args: {
			ownerHandle: "tangled.org",
			repoName: "core",
			issue
		}
	});
</script>

<Story name="Open" />
<Story name="Closed" args={{ issue: { ...issue, state: "closed" } }} />
<Story name="No comments" args={{ issue: { ...issue, commentCount: 0 } }} />
<Story name="Plain" args={{ border: false, shadow: false, background: false }} />
