hezarfen_frontend
Clone
https://git.tahinli.com/archive/hezarfen_frontend.git
0 watching0 forksTypeScript5.5 MiBdcf123aBurak Boduroğlu2 months ago674 commits
| 1 | import { createResource } from "@/lib/create-resource"; |
| 2 | import { cn } from "@/lib/cn"; |
| 3 | import { 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. */ |
| 7 | export 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 | } |