function toEmbedUrl(href: string): string { try { const url = new URL(href); if (url.pathname.startsWith("/embed/")) return href; const id = url.searchParams.get("v") ?? (url.hostname === "youtu.be" ? url.pathname.slice(1) : null); return id ? `https://www.youtube.com/embed/${id}` : href; } catch { return href; } } export function ShowcaseYouTube({ entries, }: { entries: { href: string; title?: string }[]; }) { return (
{entries.map((entry, i) => (