<script setup lang="ts">
import { ListboxItem as ShadcnListboxItem } from '@/components/core/listbox';
import { type UiListboxItemProps } from './types';

defineOptions({
  name: 'UiListboxItem',
});

const props = defineProps<UiListboxItemProps>();

const emit = defineEmits<{
  /** Emitted when the item is selected. */
  select: [event: Event];
}>();
</script>

<template>
  <ShadcnListboxItem v-bind="props" @select="emit('select', $event)">
    <slot />
  </ShadcnListboxItem>
</template>
