/*eslint complexity: ["error", 10]*/ /* eslint-disable max-lines */ import { BsCheckCircleFill } from "react-icons/bs"; import { Popover, PopoverContent, PopoverTrigger, } from "@/lib/components/ui/Popover"; import { cn } from "@/lib/utils"; export type SelectOptionProps = { label: string; value: T; }; type SelectProps = { options: SelectOptionProps[]; value?: T; onChange: (option: T) => void; label?: string; readOnly?: boolean; className?: string; emptyLabel?: string; popoverClassName?: string; popoverSide?: "top" | "bottom" | "left" | "right" | undefined; }; const selectedStyle = "rounded-lg bg-black text-white"; export const Select = ({ onChange, options, value, label, readOnly = false, className, emptyLabel, popoverClassName, popoverSide, }: SelectProps): JSX.Element => { const selectedValueLabel = options.find( (option) => option.value === value )?.label; if (readOnly) { return (
{label !== undefined && ( )}
); } return (
{label !== undefined && ( )}
    {options.map((option) => (
  • onChange(option.value)} >
    {option.label} {value === option.value && }
  • ))}
); };