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

	const branches = [
		{
			name: "main",
			hash: "0123456789abcdef0123456789abcdef01234567",
			when: "2026-07-28T09:00:00Z",
			isDefault: true
		},
		{
			name: "feature/storybook",
			hash: "abcdef0123456789abcdef0123456789abcdef01",
			when: "2026-07-27T09:00:00Z",
			isDefault: false
		}
	];

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

<Story name="Current branch has no compare link" />
<Story name="Feature branch selected" args={{ currentRef: "feature/storybook" }} />
<Story
	name="Branch without timestamp"
	args={{ branches: [{ name: "main", hash: "0123456789abcdef", isDefault: true }] }}
/>
<Story name="No branches" args={{ branches: [] }} />
