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

export interface ComboboxProps extends ComboboxRootProps {
  class?: HTMLAttributes["class"]
}

const props = defineProps<ComboboxProps>()
const emits = defineEmits<ComboboxRootEmits>()

const delegatedProps = reactiveOmit(props, "class")

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

<template>
  <ComboboxRoot
    v-bind="forwarded"
    :class="cn('relative', props.class)"
  >
    <slot />
  </ComboboxRoot>
</template>
