<script setup lang="ts">
defineProps<{
  tabs: Array<{ key: string; label: string }>;
  modelValue: string;
}>();

defineEmits<{
  "update:modelValue": [value: string];
}>();
</script>

<template>
  <div class="-mb-px flex gap-6">
    <button
      v-for="tab in tabs"
      :key="tab.key"
      type="button"
      class="pb-3 text-sm font-medium border-b-2 transition-colors"
      :class="
        modelValue === tab.key
          ? 'border-primary text-foreground'
          : 'border-transparent text-muted-foreground hover:text-foreground'
      "
      @click="$emit('update:modelValue', tab.key)"
    >
      {{ tab.label }}
    </button>
  </div>
</template>
