<script setup lang="ts">
import type { TabsTriggerProps } from "reka-ui"
import type { HTMLAttributes } from "vue"
import type { TabsTriggerVariants } from "."
import { reactiveOmit } from "@vueuse/core"
import { TabsTrigger, useForwardProps } from "reka-ui"
import { cn } from "@/lib/utils"
import { tabsTriggerVariants } from "."

export interface TabsTriggerWrapperProps extends TabsTriggerProps {
  variant?: TabsTriggerVariants["variant"]
  class?: HTMLAttributes["class"]
}

const props = defineProps<TabsTriggerWrapperProps>()
const delegatedProps = reactiveOmit(props, "class", "variant")
const forwardedProps = useForwardProps(delegatedProps)
</script>

<template>
  <TabsTrigger
    v-bind="forwardedProps"
    :class="cn(tabsTriggerVariants({ variant }), props.class)"
  >
    <slot />
  </TabsTrigger>
</template>
