import { html, type Raw } from './html.ts'; export function layout(title: string, body: Raw): string { return ` ${html` ${title}
${body}
`}`; } /** * Indicative brand accents. The written label is what actually identifies * the platform; the colour is only there to make it recognisable at a * glance. */ const ACCENT: Record = { x: { color: '#0f1419', monogram: '✕' }, threads: { color: '#3b3b3b', monogram: '@' }, instagram: { color: '#c13584', monogram: 'IG' }, tiktok: { color: '#fe2c55', monogram: '♪' }, bluesky: { color: '#0085ff', monogram: 'B' }, reddit: { color: '#ff4500', monogram: 'r' }, }; export function badge(platform: string, label: string): Raw { const accent = ACCENT[platform] ?? { color: '#666', monogram: '?' }; return html` ${label} `; } /** The copy control, plus the URL itself so it is always selectable even if * the clipboard API is unavailable. */ export function originalUrlBlock(originalUrl: string, platformLabel: string): Raw { return html`
Open on ${platformLabel}

${originalUrl}

`; }