import React from "react"; // headless ui import { Combobox } from "@headlessui/react"; // icons import { Check } from "lucide-react"; // components import { DropdownOptionsLoader, InputSearch } from "."; // helpers import { cn } from "../../../helpers"; // types import { IMultiSelectDropdownOptions, ISingleSelectDropdownOptions } from "../dropdown"; export const DropdownOptions: React.FC = (props) => { const { isOpen, query, setQuery, inputIcon, inputPlaceholder, inputClassName, inputContainerClassName, disableSearch, keyExtractor, options, handleClose, value, renderItem, loader, isMobile = false, } = props; return ( <> {!disableSearch && ( setQuery(query)} inputIcon={inputIcon} inputPlaceholder={inputPlaceholder} inputClassName={inputClassName} inputContainerClassName={inputContainerClassName} isMobile={isMobile} /> )}
<> {options ? ( options.length > 0 ? ( options?.map((option) => ( cn( "flex w-full cursor-pointer select-none items-center justify-between gap-2 truncate rounded px-1 py-1.5", { "bg-custom-background-80": active, "text-custom-text-100": selected, "text-custom-text-200": !selected, }, option.className && option.className({ active, selected }) ) } onClick={handleClose} > {({ selected }) => ( <> {renderItem ? ( <>{renderItem({ value: keyExtractor(option), selected, disabled: option.disabled })} ) : ( <> {option.value} {selected && } )} )} )) ) : (

No matching results

) ) : loader ? ( <> {loader} ) : ( )}
); };