feat(components): add MacroIcon badge component with count and warning indicator

This commit is contained in:
Thorsten Bus 2026-05-04 00:30:28 +02:00
parent c714f30647
commit 444e6704c5

View file

@ -0,0 +1,27 @@
<script setup>
defineProps({
count: { type: Number, default: 0 },
hasWarning: { type: Boolean, default: false },
})
defineEmits(['click'])
</script>
<template>
<button
v-if="count > 0"
class="relative flex items-center justify-center rounded-lg bg-amber-100 px-2 py-1 text-xs font-medium text-amber-700 transition-colors hover:bg-amber-200"
:aria-label="`${count} Makro-Zuweisungen`"
@click="$emit('click')"
>
<svg class="h-3.5 w-3.5 shrink-0" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2">
<path stroke-linecap="round" stroke-linejoin="round" d="M13 10V3L4 14h7v7l9-11h-7z" />
</svg>
<span class="ml-1">{{ count }}</span>
<span
v-if="hasWarning"
class="absolute -right-1 -top-1 flex h-3 w-3 items-center justify-center rounded-full bg-red-500"
aria-label="Warnung: deaktiviertes Makro"
/>
</button>
</template>