Something went wrong. Try again.
Monorepo for Tangled
Something went wrong. Try again.
Svelte
at icy/tmrrpn
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253<script lang="ts"> import { resolve } from "$app/paths"; import type { ResolvedPathname } from "$app/types"; import User from "$lib/components/ui/User.svelte"; import ProfilePopover from "$lib/components/profile/ProfilePopover.svelte"; import TimeAgo from "$lib/components/ui/TimeAgo.svelte"; import PullStatePill from "./PullStatePill.svelte"; import type { PullSummary } from "$lib/components/repo/types"; import Separator from "$lib/components/ui/Separator.svelte"; import { formatCount } from "$lib/format";
interface Props { ownerHandle: string; repoName: string; pull: PullSummary; }
let { ownerHandle, repoName, pull }: Props = $props();
// the at-uri is appended after `resolve`, which would drop the empty segment in `at://` const href = $derived( `${resolve(`/${ownerHandle}/${repoName}/pulls` as "/")}/${pull.uri}/latest` as ResolvedPathname );</script>
<div class="pb-2"> <a {href} class="text-foreground-default hover:underline"> <span>{pull.title}</span> <span class="text-foreground-muted">#{pull.rkey}</span> </a></div>
<div class="flex flex-wrap items-center gap-x-1 gap-y-1.5 text-foreground-muted"> <PullStatePill state={pull.state} />
<span class="ml-1 flex items-center gap-1"> <ProfilePopover did={pull.authorDid}> <User handle={pull.authorHandle} did={pull.authorDid} link /> </ProfilePopover> </span>
<Separator variant="dot" />
<TimeAgo value={pull.createdAt} />
<Separator variant="dot" />
<a {href} class="text-foreground-muted no-underline hover:underline"> {formatCount(pull.commentCount)} {pull.commentCount === 1 ? "comment" : "comments"} </a></div>