Files
tabler/shared/ui/Illustration.astro
T

21 lines
595 B
Plaintext

---
import { freeIllustrationSource, illustrationSvg, type IllustrationImage } from '@shared/lib/svg'
interface Props {
/** file name of the illustration, e.g. "boy-girl.svg" (the ".svg" suffix is stripped) */
image: IllustrationImage
height?: number | string
class?: string
}
const { image, height = 128, class: className } = Astro.props
const source = freeIllustrationSource(image)
const illustration = illustrationSvg(source, { ...(className ? { classes: className } : {}), height })
---
<!-- BEGIN ILLUSTRATION -->
<Fragment set:html={illustration} />
<!-- END ILLUSTRATION -->