import { getProfile, getSembleData, type SembleData } from "../data.ts"; import { PageNav } from "./page-nav.tsx"; function publicUrl(value: string): URL | undefined { try { const url = new URL(value); return ["https:", "http:"].includes(url.protocol) ? url : undefined; } catch { return undefined; } } function excerpt(description: string): string { const text = description.replace(/\s+/g, " ").trim(); if (text.length <= 300) return text; const end = text.lastIndexOf(" ", 300); return `${text.slice(0, end > 0 ? end : 300)}…`; } // Read-only projection of Cameron's existing public Semble bookmarks, not contacts. export function LinksContent({ data }: { data: SembleData }) { const cards = data.cards.filter((card) => card.type === "URL" && publicUrl(card.url)); return (

Links

Saved reading and interesting things from my public{" "} Semble collection.

{!data.available ? (

The saved links could not be loaded right now. You can still browse them on Semble.

) : cards.length === 0 ? (

No saved links yet.

) : ( )}
); } export async function Links() { const [profile, data] = await Promise.all([getProfile(), getSembleData(100)]); return (
); }