<template>
  <UTabs v-model="activeTab" :content="false" :items="tabs" size="sm" />
</template>

<script setup lang="ts">
import type { TabsItem } from '@nuxt/ui'
import type { PropType } from 'vue'
import { IPvzMapTabs } from '#shared/types'
import { computed } from 'vue'

const activeTab = defineModel('activeTab', { type: Object as PropType<IPvzMapTabs>, default: () => IPvzMapTabs.MAP })

const tabs = computed<TabsItem[]>(() =>
  [
    {
      value: IPvzMapTabs.MAP,
      label: activeTab.value === IPvzMapTabs.MAP ? 'Карта' : '',
      icon: 'lucide:map-pin',
    },
    {
      value: IPvzMapTabs.LIST,
      label: activeTab.value === IPvzMapTabs.LIST ? 'Список' : '',
      icon: 'i-lucide-list',
    },
  ],
)
</script>
