feat: added reusable badge bar and lucide icon wrapper

Changed files
+38
src
+26
src/components/Badgebar.astro
···
+
---
+
import LucideIcon from "./LucideIcon.astro";
+
+
interface Badge {
+
icon: string,
+
href: string
+
color: string
+
}
+
+
interface Props {
+
badges: Badge[]
+
size: string
+
}
+
+
const { badges, size } = Astro.props
+
---
+
<span class="flex gap-2 bg-ctp-crust p-2 pl-3 pr-3 rounded-full h-min">
+
{badges.map(badge =>
+
<a href=`${badge.href}`>
+
<LucideIcon name=`${badge.icon}` width=`${size}` height=`${size}` style={`stroke:${badge.color}`}
+
class="hover:rotate-15 ease-in hover:ease-out transition-transform"
+
/>
+
</a>
+
)}
+
</span>
+
+12
src/components/LucideIcon.astro
···
+
---
+
import { icons, type IconProps } from '@lucide/astro';
+
+
interface Props extends IconProps {
+
name: keyof typeof icons;
+
}
+
+
const { name, ...restProps } = Astro.props;
+
const Icon = icons[name];
+
---
+
+
<Icon {...restProps} />