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

	const commit = {
		hash: "0123456789abcdef0123456789abcdef01234567",
		shortHash: "01234567",
		subject: "add the repository index",
		body: "",
		authorName: "dawn",
		authorEmail: "dawn@example.test",
		when: "2026-07-28T09:00:00Z"
	};

	const { Story } = defineMeta({
		title: "Repo/LastCommitPanel",
		component: LastCommitPanel,
		tags: ["autodocs"],
		args: { ownerHandle: "dawn", repoName: "tangled", commit }
	});
</script>

<Story name="Author, subject, time, and hash" />
<Story
	name="Minimal commit metadata"
	args={{ commit: { ...commit, authorName: "", when: "", subject: "update files" } }}
/>
