<script lang="ts">
	import EmptyState from "$lib/components/ui/EmptyState.svelte";
	import IssueCard from "./IssueCard.svelte";
	import type { IssueSummary } from "$lib/components/repo/types";

	interface Props {
		ownerHandle: string;
		repoName: string;
		issues: IssueSummary[];
	}

	let { ownerHandle, repoName, issues }: Props = $props();
</script>

{#if issues.length === 0}
	<EmptyState message="No issues yet." />
{:else}
	<div class="flex flex-col gap-2">
		{#each issues as issue (issue.rkey)}
			<IssueCard {ownerHandle} {repoName} {issue} />
		{/each}
	</div>
{/if}
