<script setup lang="ts">
/**
 * 文件职责：发票管理分段切换栏。
 */
import type { FinanceInvoiceTabKey } from '../types';

import { Segmented } from 'ant-design-vue';

interface Props {
  activeTab: FinanceInvoiceTabKey;
  options: Array<{ label: string; value: FinanceInvoiceTabKey }>;
}

const props = defineProps<Props>();

const emit = defineEmits<{
  (event: 'update:activeTab', value: FinanceInvoiceTabKey): void;
}>();
</script>

<template>
  <div v-if="props.options.length > 0" class="fi-seg-wrap">
    <Segmented
      :value="props.activeTab"
      :options="props.options"
      @update:value="(value) => emit('update:activeTab', value as FinanceInvoiceTabKey)"
    />
  </div>
</template>
