// Link icons, drawn in the link's color. import { said, type Key } from "./text.ts"; const ICONS = { download: ``, gitea: ``, }; /** A link with `icon` before its keyed text. */ export function iconLink(icon: keyof typeof ICONS, key: Key, href: string): HTMLAnchorElement { const a = document.createElement("a"); a.href = href; a.className = "icon"; a.innerHTML = ICONS[icon]; a.firstElementChild!.setAttribute("aria-hidden", "true"); a.append(said("span", key)); return a; }