forge
Explore
Log in

Don't you dare go Hollow

hezarfen_frontend

Clone
★ 0

0 watching0 forksTypeScript5.5 MiBdcf123aBurak Boduroğlu2 months ago674 commits

illustration.tsx18 lines, 716 bytesHistoryRawDownload
1import { createResource } from "@/lib/create-resource";
2import { cn } from "@/lib/cn";
3import { loadIllustration, type IllustrationName } from "@/lib/illustrations";
4
5/** Decorative, theme-tinted unDraw scene. Loaded on demand so empty states
6 * don't pull every SVG into the main bundle. */
7export function Illustration(props: { name: IllustrationName; class?: string }) {
8 const [svg] = createResource(() => props.name, loadIllustration);
9
10 return (
11 <span
12 class={cn("illustration pointer-events-none block select-none [&>svg]:h-full [&>svg]:w-full", props.class)}
13 aria-hidden="true"
14 // Local, build-time assets only — never user content.
15 innerHTML={svg.latest ?? ""}
16 />
17 );
18}