<script module lang="ts">
	import { defineMeta } from "@storybook/addon-svelte-csf";
	import StoryAuthProvider from "../../../../.storybook/StoryAuthProvider.svelte";
	import EmptyRepo from "./EmptyRepo.svelte";
	import type { RepoInfo } from "./types";

	const ownerDid = "did:plc:owner";
	const ownerRepo: RepoInfo = {
		uri: "at://did:plc:repo/sh.tangled.repo.repo/3jzrepo",
		rkey: "3jzrepo",
		name: "tangled",
		ownerDid,
		ownerHandle: "dawn",
		repoDid: "did:plc:repo",
		knot: "knot1.tangled.sh",
		defaultBranch: "main"
	};
	const otherRepo = { ...ownerRepo, ownerDid: "did:plc:other", ownerHandle: "other" };

	const { Story } = defineMeta({
		title: "Repo/EmptyRepo",
		component: EmptyRepo,
		tags: ["autodocs"]
	});
</script>

<Story name="Owner instructions" asChild>
	<StoryAuthProvider initial={{ did: ownerDid, handle: "dawn" }}>
		<EmptyRepo repo={ownerRepo} hasSshKey={false} />
	</StoryAuthProvider>
</Story>
<Story name="Owner with SSH key" asChild>
	<StoryAuthProvider initial={{ did: ownerDid, handle: "dawn" }}>
		<EmptyRepo repo={ownerRepo} hasSshKey={true} />
	</StoryAuthProvider>
</Story>
<Story name="Visitor" asChild>
	<StoryAuthProvider>
		<EmptyRepo repo={otherRepo} />
	</StoryAuthProvider>
</Story>
