11<script setup lang="ts">
22import { computed , onMounted , onUnmounted , ref , watch } from ' vue'
3- import { Icon } from ' @iconify/vue'
3+ import LucideAlertTriangle from ' ~/components/kun/icon/LucideAlertTriangle.vue'
4+ import LucideCheckCircle2 from ' ~/components/kun/icon/LucideCheckCircle2.vue'
5+ import LucideInfo from ' ~/components/kun/icon/LucideInfo.vue'
6+ import LucideXCircle from ' ~/components/kun/icon/LucideXCircle.vue'
47import type { KunMessageType } from ' ~/composables/useMessage'
58
69const props = defineProps <{
@@ -83,23 +86,23 @@ const typeStyles = computed(() => {
8386 text: ' text-success-800' ,
8487 icon: ' text-success-500' ,
8588 progress: ' bg-success-400' ,
86- iconName: ' lucide:check-circle-2 '
89+ iconComponent: LucideCheckCircle2
8790 }
8891 case ' error' :
8992 return {
9093 bg: ' bg-danger-50 dark:bg-danger-50/90' ,
9194 text: ' text-danger-800' ,
9295 icon: ' text-danger-500' ,
9396 progress: ' bg-danger-400' ,
94- iconName: ' lucide:x-circle '
97+ iconComponent: LucideXCircle
9598 }
9699 case ' warn' :
97100 return {
98101 bg: ' bg-warning-50 dark:bg-warning-50/90' ,
99102 text: ' text-warning-800' ,
100103 icon: ' text-warning-500' ,
101104 progress: ' bg-warning-400' ,
102- iconName: ' lucide:alert-triangle '
105+ iconComponent: LucideAlertTriangle
103106 }
104107 case ' info' :
105108 default :
@@ -108,7 +111,7 @@ const typeStyles = computed(() => {
108111 text: ' text-primary-800' ,
109112 icon: ' text-primary-500' ,
110113 progress: ' bg-primary-400' ,
111- iconName: ' lucide:info '
114+ iconComponent: LucideInfo
112115 }
113116 }
114117})
@@ -126,9 +129,9 @@ const typeStyles = computed(() => {
126129 @mouseenter =" pauseTimer"
127130 @mouseleave =" resumeTimer"
128131 >
129- <Icon
132+ <component
133+ :is =" typeStyles.iconComponent"
130134 :class =" cn('mt-0.5 mr-3 h-6 w-6 flex-shrink-0', typeStyles.icon)"
131- :icon =" typeStyles.iconName"
132135 />
133136
134137 <div class =" flex-1 text-sm font-medium" >
0 commit comments