/** * Copyright (c) 2023-present Plane Software, Inc. and contributors * SPDX-License-Identifier: AGPL-3.0-only * See the LICENSE file for details. */ import { Combobox } from "@headlessui/react"; import React from "react"; import { CheckIcon } from "@plane/propel/icons"; // helpers import { cn } from "../../utils"; // types import type { IMultiSelectDropdownOptions, ISingleSelectDropdownOptions } from "../dropdown"; // components import { DropdownOptionsLoader, InputSearch } from "."; export function DropdownOptions(props: IMultiSelectDropdownOptions | ISingleSelectDropdownOptions) { const { isOpen, query, setQuery, inputIcon, inputPlaceholder, inputClassName, inputContainerClassName, disableSearch, keyExtractor, options, handleClose, 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( "nodedc-dropdown-option", { "bg-white/6": active, "text-primary": selected, "text-secondary": !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} ) : ( )}
); }