import { FC, useEffect, useState } from "react"; import { observer } from "mobx-react"; import { ChevronLeft } from "lucide-react"; import { TEstimateUpdateStageKeys } from "@plane/types"; import { Button } from "@plane/ui"; // components import { EModalPosition, EModalWidth, ModalCore } from "@/components/core"; import { EstimatePointEditRoot, EstimateUpdateStageOne } from "@/components/estimates"; type TUpdateEstimateModal = { workspaceSlug: string; projectId: string; estimateId: string | undefined; isOpen: boolean; handleClose: () => void; }; export const UpdateEstimateModal: FC = observer((props) => { // props const { workspaceSlug, projectId, estimateId, isOpen, handleClose } = props; // states const [estimateEditType, setEstimateEditType] = useState(undefined); const handleEstimateEditType = (type: TEstimateUpdateStageKeys) => setEstimateEditType(type); useEffect(() => { if (!isOpen) setEstimateEditType(undefined); }, [isOpen]); return (
{/* heading */}
{estimateEditType && (
setEstimateEditType(undefined)} className="flex-shrink-0 cursor-pointer w-5 h-5 flex justify-center items-center" >
)}
Edit estimate system
{!estimateEditType && } {estimateEditType && estimateId && ( )}
); });