This repository has no description
1<script lang="ts">
2 import { resolve } from "$app/paths";
3 import Avatar from "$lib/components/ui/Avatar.svelte";
4 import TimeAgo from "$lib/components/ui/TimeAgo.svelte";
5 import type { CommitSummary } from "./types";
6
7 interface Props {
8 ownerHandle: string;
9 repoName: string;
10 commit: CommitSummary;
11 }
12
13 let { ownerHandle, repoName, commit }: Props = $props();
14
15 const href = $derived(resolve(`/${ownerHandle}/${repoName}/commit/${commit.hash}` as "/"));
16</script>
17
18<div
19 class="mb-3 hidden flex-wrap items-center justify-between gap-2 border-b border-border-default pb-2 typography-paragraph-small md:flex"
20>
21 <div class="flex min-w-0 flex-wrap items-center gap-2">
22 {#if commit.authorName}
23 <!-- no email→did mapping yet, always the placeholder -->
24 <Avatar size="regular" />
25 <span class="truncate text-foreground-default">{commit.authorName}</span>
26 <span class="text-foreground-subtle" aria-hidden="true">·</span>
27 {/if}
28 <a {href} class="min-w-0 truncate text-foreground-default no-underline hover:underline">
29 {commit.subject}
30 </a>
31 {#if commit.when}
32 <span class="text-foreground-subtle" aria-hidden="true">·</span>
33 <span class="text-foreground-subtle"><TimeAgo value={commit.when} /></span>
34 {/if}
35 </div>
36 <a
37 {href}
38 class="w-fit rounded-sm bg-background-inset px-2 py-1 font-mono typography-monospace-small text-foreground-muted no-underline hover:underline"
39 >
40 {commit.shortHash}
41 </a>
42</div>