<script setup lang="ts">
import type { ListboxFilterEmits, ListboxFilterProps } from 'reka-ui';
import type { HTMLAttributes } from 'vue';
import { ListboxFilter, useForwardPropsEmits } from 'reka-ui';
import { computed } from 'vue';
import { cn, omitClass } from '@/lib/utils';

const props = defineProps<
  ListboxFilterProps & { class?: HTMLAttributes['class'] }
>();
const emits = defineEmits<ListboxFilterEmits>();

const delegatedProps = computed(() => omitClass(props));

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

<template>
  <ListboxFilter
    data-slot="listbox-filter"
    :class="
      cn(
        'placeholder:text-muted-foreground flex h-9 w-full rounded-md bg-transparent px-3 py-2 text-sm outline-none disabled:cursor-not-allowed disabled:opacity-50',
        props.class,
      )
    "
    v-bind="forwarded"
  />
</template>
