"use client"; import { CustomSearchSelect, Tooltip } from "@plane/ui"; // silo types import { TDropdown } from "@/plane-web/silo/types/ui"; export const Dropdown = (props: TDropdown) => { const { dropdownOptions, onChange, value, placeHolder, disabled = false, iconExtractor, queryExtractor } = props; // derived values const className = ""; const buttonClassName = "w-full min-h-8 h-full"; const optionsClassName = ""; const selectedState = dropdownOptions.find((option) => option.key === value); const dropdownLabel = selectedState ? (
{iconExtractor && selectedState && iconExtractor(selectedState.data as T)}
{selectedState?.label}
) : placeHolder ? ( placeHolder ) : ( "Select" ); const dropdownOptionsRender = (dropdownOptions ? Object.values(dropdownOptions).flat() : []).map((dropdownItem) => ({ value: dropdownItem?.value, query: queryExtractor ? queryExtractor(dropdownItem.data as T) : `${dropdownItem?.label}`, content: (
{iconExtractor && iconExtractor(dropdownItem.data as T)}
{dropdownItem?.label}
), })); return ( ); };