feat: initial commit
This commit is contained in:
commit
0ff7457679
192 changed files with 24379 additions and 0 deletions
42
src/components/IconMapper.astro
Normal file
42
src/components/IconMapper.astro
Normal file
|
@ -0,0 +1,42 @@
|
|||
---
|
||||
import icons from "@cdransf/astro-tabler-icons";
|
||||
|
||||
const {
|
||||
IconArticle,
|
||||
IconHeadphones,
|
||||
IconDeviceTvOld,
|
||||
IconBooks,
|
||||
IconLink,
|
||||
IconInfoCircle,
|
||||
IconSearch,
|
||||
IconRss,
|
||||
IconBrandMastodon,
|
||||
IconMail,
|
||||
IconBrandGithub,
|
||||
IconBrandNpm,
|
||||
IconCoffee,
|
||||
IconDeviceWatch,
|
||||
IconHeartHandshake,
|
||||
} = icons;
|
||||
const { icon, className } = Astro.props;
|
||||
const iconComponents = {
|
||||
article: IconArticle,
|
||||
headphones: IconHeadphones,
|
||||
"device-tv-old": IconDeviceTvOld,
|
||||
books: IconBooks,
|
||||
link: IconLink,
|
||||
"info-circle": IconInfoCircle,
|
||||
search: IconSearch,
|
||||
rss: IconRss,
|
||||
"brand-mastodon": IconBrandMastodon,
|
||||
mail: IconMail,
|
||||
"brand-github": IconBrandGithub,
|
||||
"brand-npm": IconBrandNpm,
|
||||
coffee: IconCoffee,
|
||||
"device-watch": IconDeviceWatch,
|
||||
"heart-handshake": IconHeartHandshake,
|
||||
};
|
||||
const SelectedIcon = iconComponents[icon?.toLowerCase()] || null;
|
||||
---
|
||||
|
||||
{SelectedIcon ? <div set:html={SelectedIcon({ size: 24, className })} /> : null}
|
Reference in a new issue