11<script setup lang="ts">
2- import DisplayBadge from ' @antfu/design/components/Display/DisplayBadge .vue'
2+ import MessageTag from ' ./MessageTag .vue'
33
44defineProps <{
55 label: string
66 items: string []
77 active: Set <string >
88 /** Map item key → { icon, color, label } for styled (level/source) items. */
99 styles? : Record <string , { icon? : string , color? : string , label? : string }>
10- /** Render items as hash-colored `DisplayBadge ` chips (category/label). */
11- badge ? : boolean
10+ /** Render items as hash-colored `MessageTag ` chips of this kind (category/label). */
11+ tag ? : ' category ' | ' label '
1212}>()
1313
1414defineEmits <{
@@ -29,14 +29,14 @@ function isDimmed(active: Set<string>, item: string): boolean {
2929 type =" button"
3030 class =" rounded flex items-center transition"
3131 :class =" [
32- badge ? 'p-0.5' : 'px-1.5 py-0.5 gap-0.5 text-xs',
33- !badge && !isDimmed(active, item) ? (styles?.[item]?.color || '') : '',
32+ tag ? 'p-0.5' : 'px-1.5 py-0.5 gap-0.5 text-xs',
33+ !tag && !isDimmed(active, item) ? (styles?.[item]?.color || '') : '',
3434 isDimmed(active, item) ? 'op30 saturate-50' : '',
3535 ]"
3636 @click =" $emit('toggle', item)"
3737 >
38- <template v-if =" badge " >
39- <DisplayBadge :text =" item " class="text-xs " />
38+ <template v-if =" tag " >
39+ <MessageTag :text =" item " : kind = " tag " />
4040 </template >
4141 <template v-else >
4242 <div v-if =" styles?.[item]?.icon" :class =" styles[item]!.icon" class =" w-3.5 h-3.5" />
0 commit comments