/** * Lit rendering for the shared icon registry (`registry.generated.ts`, * generated by tools/icons/generate.mjs: the curated Lucide set plus the full * Font Awesome Free Solid set). The glyph path data is bundled — no CDN and * no runtime fetch. */ import { html, svg, type TemplateResult } from "lit"; import { resolveIcon } from "./registry.generated"; /** * A stored definition icon (`lucide:`, `fa:`, `emoji:` * or a legacy bare Lucide name) as a template; anything that resolves to the * registry fallback renders `fallback` instead. */ export function renderQuestIcon( value: string | null, fallback: TemplateResult ): TemplateResult { const icon = resolveIcon(value); switch (icon.kind) { case "lucide": return html``; case "fa": return html``; case "emoji": return html`${icon.text}`; case "fallback": return fallback; } }