feat: use lucide icons

This commit is contained in:
Shivam Mishra
2024-10-21 13:36:35 +05:30
parent 4e64097421
commit 74d9b84337
2 changed files with 20 additions and 4 deletions
@@ -0,0 +1,17 @@
<script setup>
import { h, isVNode } from 'vue';
const props = defineProps({
icon: { type: [String, Object, Function], required: true },
});
const renderIcon = () => {
if (!props.icon) return null;
if (typeof props.icon === 'function' || isVNode(props.icon)) {
return props.icon;
}
return h('span', { class: props.icon });
};
</script>
<template>
<component :is="renderIcon" />
</template>