"use client"

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

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

const BaseComboboxPositioner = BaseCombobox.Positioner as React.ElementType

export const ComboboxPositioner = React.forwardRef<HTMLElement, ComboboxPositionerProps>(
  ({ className, ...props }, ref) => (
    <BaseComboboxPositioner
      ref={ref}
      className={cn(
        "outline-none",
        className,
      )}
      {...props}
    />
  ),
)

ComboboxPositioner.displayName = "ComboboxPositioner"
