"use client"

import * as React from "react"
import { Combobox as BaseCombobox } from "@base-ui/react/combobox"
import { cn } from "@/lib/utils"

export type ComboboxCollectionProps = React.ComponentPropsWithoutRef<typeof BaseCombobox.Collection> & {
  className?: string
}

const BaseComboboxCollection = BaseCombobox.Collection as React.ElementType

export const ComboboxCollection = React.forwardRef<HTMLElement, ComboboxCollectionProps>(
  ({ className, ...props }, ref) => (
    <BaseComboboxCollection
      ref={ref}
      className={cn(className)}
      {...props}
    />
  ),
)

ComboboxCollection.displayName = "ComboboxCollection"
