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

const props = defineProps<
  ListboxGroupLabelProps & { class?: HTMLAttributes['class'] }
>();

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

const forwardedProps = useForwardProps(delegatedProps);
</script>

<template>
  <ListboxGroupLabel
    data-slot="listbox-group-label"
    :class="
      cn('text-muted-foreground px-2 py-1.5 text-xs font-medium', props.class)
    "
    v-bind="forwardedProps"
  >
    <slot />
  </ListboxGroupLabel>
</template>
