Something went wrong. Try again.
Attic is a cozy space with lofty ambitions. attic.social
Something went wrong. Try again.
1.0 kB · 44 lines
Svelte
at main
123456789101112131415161718192021222324252627282930313233343536373839404142434445<script lang="ts" module> import type { BookmarkEntity } from "$lib/types";
type Props = { entity: BookmarkEntity; formattedCreatedAt: string; onclick?: () => void; };</script>
<script lang="ts"> const { entity, formattedCreatedAt, onclick }: Props = $props();</script>
<article id={entity.cid} class="Bookmark"> <h3> <a href={entity.url} rel="noopener noreferrer" target="_blank"> <img alt="" width="16" height="16" decoding="async" fetchpriority="low" loading="lazy" src="/bookmarks/favicon/{new URL(entity.url).hostname}" /> {entity.title} </a> {#if onclick} <button type="button" {onclick}> Edit </button> {/if} </h3> <time datetime={entity.createdAt}> {formattedCreatedAt} </time> <code aria-hidden="true">{entity.url}</code> {#if entity.tags?.length} <ul> {#each entity.tags as tag} <li>{tag}</li> {/each} </ul> {/if}</article>