Something went wrong. Try again.
Monorepo for Tangled
Something went wrong. Try again.
Svelte
at icy/tmrrpn
123456789101112131415161718192021222324252627<script lang="ts"> import History from "$icon/history"; import Route from "$icon/route"; import PreviewCard from "./PreviewCard.svelte"; import PreviewEmpty from "./PreviewEmpty.svelte"; import RecentItem, { recentPath } from "./RecentItem.svelte"; import type { RecentItemData } from "./types";
let { items = [] }: { items?: RecentItemData[] } = $props();</script>
<PreviewCard title="Recents" icon={History}> {#if items.length > 0} <div class="relative flex flex-col rounded-b bg-background-default"> <!-- the thread the avatars and badges sit on, centred on the icon column --> <div class="absolute inset-y-0 w-px bg-border-default" style="left: 1.875rem"></div> {#each items as item (recentPath(item))} <RecentItem {item} /> {/each} </div> {:else} <PreviewEmpty icon={Route}> <p class="text-foreground-subtle">No recent pages yet.</p> </PreviewEmpty> {/if}</PreviewCard>