Files
atridotdad/src/components/Icon.astro
Atridad Lahiji 89c1c739c1
All checks were successful
Docker Deploy / build-and-push (push) Successful in 3m48s
Re-worked icons
2026-02-12 14:22:59 -07:00

28 lines
532 B
Plaintext

---
import { icons, type IconName } from "../config/icons";
interface Props {
name: IconName;
class?: string;
"class:list"?: any;
}
const { name, class: className, "class:list": classList } = Astro.props;
const svg = icons[name];
if (!svg) {
throw new Error(`Icon "${name}" not found in icon registry`);
}
---
<svg
xmlns="http://www.w3.org/2000/svg"
viewBox="0 0 24 24"
width="1em"
height="1em"
fill="none"
class:list={[className, classList]}
aria-hidden="true"
set:html={svg}
/>