<script module lang="ts">
  import type { Snippet } from 'svelte'
  import type { CollectionItem } from '../collection/index.ts'
  import type { UseComboboxContext } from './use-combobox-context.ts'

  export interface ComboboxContextProps<T extends CollectionItem> {
    render: Snippet<[UseComboboxContext<T>]>
  }
</script>

<script lang="ts" generics="T extends CollectionItem">
  import { useComboboxContext } from './use-combobox-context.ts'

  const { render }: ComboboxContextProps<T> = $props()

  const context = useComboboxContext()
</script>

{@render render(context)}
