<script setup lang="ts">
import type { ComboboxInputEmits, ComboboxInputProps } from "reka-ui"
import type { HTMLAttributes } from "vue"
import { reactiveOmit } from "@vueuse/core"
import { ComboboxInput, useForwardPropsEmits } from "reka-ui"
import { cn } from "@/lib/utils"

export interface ComboboxInputPrimitiveProps extends ComboboxInputProps {
  class?: HTMLAttributes["class"]
}

const props = defineProps<ComboboxInputPrimitiveProps>()
const emits = defineEmits<ComboboxInputEmits>()

const delegatedProps = reactiveOmit(props, "class")

const forwarded = useForwardPropsEmits(delegatedProps, emits)
</script>

<template>
  <ComboboxInput
    v-bind="forwarded"
    :class="cn(
      'flex w-full bg-transparent text-sm placeholder:text-muted-foreground outline-none disabled:cursor-not-allowed disabled:opacity-50',
      props.class,
    )"
  />
</template>
