import { FC } from "react"; // components import { DoubleCircleIcon, StateGroupIcon, UserGroupIcon } from "@plane/ui"; // hooks import useToast from "hooks/use-toast"; // components import { SidebarAssigneeSelect, SidebarPrioritySelect, SidebarStateSelect, TPeekOverviewModes, } from "components/issues"; // ui import { CustomDatePicker } from "components/ui"; // helpers import { copyTextToClipboard } from "helpers/string.helper"; // types import { IIssue } from "types"; import { CalendarDays, LinkIcon, Signal, Trash2 } from "lucide-react"; type Props = { handleDeleteIssue: () => void; handleUpdateIssue: (formData: Partial) => Promise; issue: IIssue; mode: TPeekOverviewModes; readOnly: boolean; workspaceSlug: string; }; export const PeekOverviewIssueProperties: FC = (props) => { const { handleDeleteIssue, handleUpdateIssue, issue, mode, readOnly } = props; // toast const { setToastAlert } = useToast(); const startDate = issue.start_date; const targetDate = issue.target_date; const minDate = startDate ? new Date(startDate) : null; minDate?.setDate(minDate.getDate()); const maxDate = targetDate ? new Date(targetDate) : null; maxDate?.setDate(maxDate.getDate()); const handleCopyLink = () => { const urlToCopy = window.location.href; copyTextToClipboard(urlToCopy).then(() => { setToastAlert({ type: "success", title: "Link copied!", message: "Issue link copied to clipboard", }); }); }; return (
{mode === "full" && (
{issue.project_detail.identifier}-{issue.sequence_id}
)}
State
handleUpdateIssue({ state: val })} disabled={readOnly} />
Assignees
handleUpdateIssue({ assignees: val })} disabled={readOnly} />
Priority
handleUpdateIssue({ priority: val })} disabled={readOnly} />
Start date
handleUpdateIssue({ start_date: val, }) } className="bg-custom-background-80 border-none" maxDate={maxDate ?? undefined} disabled={readOnly} />
Due date
handleUpdateIssue({ target_date: val, }) } className="bg-custom-background-80 border-none" minDate={minDate ?? undefined} disabled={readOnly} />
{/*
Estimate
handleUpdateIssue({ estimate_point: val })} disabled={readOnly} />
*/} {/* {({ open }) => ( <> Show {open ? "Less" : "More"} Disclosure Panel )} */}
); };