mirror of
https://seed.radicle.dev/rad:z4V1sjrXqjvFdnCUbxPFqd5p4DtH5.git
synced 2026-10-26 07:00:38 +08:00
If the user pressed that button multiple times then the "Dismiss" button would have to be pressed multiple times too because it just pops the history.
60 lines
1.4 KiB
Svelte
60 lines
1.4 KiB
Svelte
<script lang="ts">
|
|
import type { Issue } from "@bindings/cob/issue/Issue";
|
|
import type { RepoInfo } from "@bindings/repo/RepoInfo";
|
|
|
|
import * as router from "@app/lib/router";
|
|
|
|
import IssueTeaser from "@app/components/IssueTeaser.svelte";
|
|
import Icon from "./Icon.svelte";
|
|
import OutlineButton from "./OutlineButton.svelte";
|
|
|
|
const activeRouteStore = router.activeRouteStore;
|
|
|
|
interface Props {
|
|
repo: RepoInfo;
|
|
selectedIssueId?: string;
|
|
issues: Issue[];
|
|
}
|
|
|
|
/* eslint-disable prefer-const */
|
|
let { repo, selectedIssueId, issues }: Props = $props();
|
|
/* eslint-enable prefer-const */
|
|
</script>
|
|
|
|
<style>
|
|
.issue-list {
|
|
margin-top: 0.5rem;
|
|
display: flex;
|
|
flex-direction: column;
|
|
gap: 2px;
|
|
padding-bottom: 1rem;
|
|
}
|
|
</style>
|
|
|
|
<div class="global-flex" style:justify-content="space-between">
|
|
<div class="txt-medium" style:font-weight="var(--font-weight-medium)">
|
|
Issues
|
|
</div>
|
|
|
|
<OutlineButton
|
|
variant="ghost"
|
|
disabled={$activeRouteStore.resource === "repo.createIssue"}
|
|
onclick={() => {
|
|
void router.push({
|
|
resource: "repo.createIssue",
|
|
rid: repo.rid,
|
|
});
|
|
}}>
|
|
<Icon name="plus" />New
|
|
</OutlineButton>
|
|
</div>
|
|
<div class="issue-list">
|
|
{#each issues as issue}
|
|
<IssueTeaser
|
|
compact
|
|
{issue}
|
|
rid={repo.rid}
|
|
selected={issue.id === selectedIssueId} />
|
|
{/each}
|
|
</div>
|