~james/core

core/web/src/lib/components/timeline/TimelineStarEvent.svelte -rw-r--r-- 1.3 KiB
452f17b7 — james chore(import): snapshot james.dad.town/core at f70c71c7696a 16 hours ago
                                                                                
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
<script lang="ts">
	import RepoCard from "#lib/components/repo/RepoCard.svelte";
	import TimelineGroup from "#lib/components/timeline/TimelineGroup.svelte";
	import TimelineActorHeader from "#lib/components/timeline/TimelineActorHeader.svelte";
	import { toRepoCard, repoHref, repoOwner } from "#lib/components/timeline/mappers.ts";
	import type { TimelineEvent } from "#lib/components/timeline/group.ts";
	import type * as OrgTangledActorDefs from "#lib/api/lexicons/types/org/tangled/actor/defs.ts";
	import type { StarEvent } from "#lib/api/lexicons/types/org/tangled/feed/getTimeline.ts";

	let {
		actor,
		items,
		signedIn = false
	}: {
		actor: OrgTangledActorDefs.ProfileViewBasic;
		items: TimelineEvent<StarEvent>[];
		signedIn?: boolean;
	} = $props();

	const repo = $derived(items[0].event.repo);
</script>

<TimelineGroup {items}>
	{#snippet title()}
		<TimelineActorHeader {actor} verb="starred" count={items.length} plural="repositories">
			<a href={repoHref(repo)} class="text-foreground-default hover:underline"
				>{repoOwner(repo)}/{repo.slug}</a
			>
		</TimelineActorHeader>
	{/snippet}
	{#snippet row(event)}
		<RepoCard
			repo={toRepoCard(event.repo)}
			starButton={signedIn}
			border={false}
			background={false}
			padding="none"
			class="flex min-h-24 flex-col"
		/>
	{/snippet}
</TimelineGroup>