// react import React, { useState } from "react"; // icons import { ChevronDownIcon } from "@heroicons/react/24/outline"; // constants import { PRIORITIES } from "constants/project"; // components import { getPriorityIcon } from "components/icons"; import { WebViewModal } from "./web-view-modal"; // helpers import { capitalizeFirstLetter } from "helpers/string.helper"; type Props = { value: any; onChange: (value: any) => void; disabled?: boolean; }; export const PrioritySelect: React.FC = (props) => { const { value, onChange, disabled = false } = props; const [isOpen, setIsOpen] = useState(false); return ( <> { setIsOpen(false); }} > ({ label: priority ? capitalizeFirstLetter(priority) : "None", value: priority, icon: ( {getPriorityIcon(priority, "text-sm")} ), onClick: () => { setIsOpen(false); if (disabled) return; onChange(priority); }, })) || [] } /> ); };