This repository has no description
0

Configure Feed

Select the types of activity you want to include in your feed.

core / web / src / lib / components / repo / LastCommitPanel.svelte
1.3 kB 40 lines
1<script lang="ts"> 2 import { resolve } from "$app/paths"; 3 import TimeAgo from "$lib/components/ui/TimeAgo.svelte"; 4 import type { CommitSummary } from "./types"; 5 6 interface Props { 7 ownerHandle: string; 8 repoName: string; 9 commit: CommitSummary; 10 } 11 12 let { ownerHandle, repoName, commit }: Props = $props(); 13 14 const href = $derived(resolve(`/${ownerHandle}/${repoName}/commit/${commit.hash}` as "/")); 15</script> 16 17<!-- narrow screens get the per-entry times instead, there is no room for both --> 18<div 19 class="mb-3 hidden flex-wrap items-center justify-between gap-2 border-b border-border-default pb-2 text-sm md:flex" 20> 21 <div class="flex min-w-0 flex-wrap items-center gap-2"> 22 {#if commit.authorName} 23 <span class="truncate text-foreground-muted">{commit.authorName}</span> 24 <span class="text-foreground-subtle" aria-hidden="true">&middot;</span> 25 {/if} 26 <a {href} class="min-w-0 truncate text-foreground-default no-underline hover:underline"> 27 {commit.subject} 28 </a> 29 {#if commit.when} 30 <span class="text-foreground-subtle" aria-hidden="true">&middot;</span> 31 <span class="text-foreground-subtle"><TimeAgo value={commit.when} /></span> 32 {/if} 33 </div> 34 <a 35 {href} 36 class="w-fit rounded bg-background-inset px-2 py-1 font-mono text-xs text-foreground-muted no-underline hover:underline" 37 > 38 {commit.shortHash} 39 </a> 40</div>