import { FC } from "react"; import { observer } from "mobx-react-lite"; import { CalendarDays, Signal, Tag, Triangle, LayoutPanelTop } from "lucide-react"; // hooks import { useIssueDetail, useProject } from "hooks/store"; // ui icons import { DiceIcon, DoubleCircleIcon, UserGroupIcon, ContrastIcon } from "@plane/ui"; import { IssueLinkRoot, IssueCycleSelect, IssueModuleSelect, IssueParentSelect, IssueLabel, TIssueOperations, } from "components/issues"; import { EstimateDropdown, PriorityDropdown, ProjectMemberDropdown, StateDropdown } from "components/dropdowns"; // components import { CustomDatePicker } from "components/ui"; interface IPeekOverviewProperties { workspaceSlug: string; projectId: string; issueId: string; disabled: boolean; issueOperations: TIssueOperations; } export const PeekOverviewProperties: FC = observer((props) => { const { workspaceSlug, projectId, issueId, issueOperations, disabled } = props; // store hooks const { getProjectById } = useProject(); const { issue: { getIssueById }, } = useIssueDetail(); // derived values const issue = getIssueById(issueId); if (!issue) return <>; const projectDetails = getProjectById(issue.project_id); const isEstimateEnabled = projectDetails?.estimate; const minDate = issue.start_date ? new Date(issue.start_date) : null; minDate?.setDate(minDate.getDate()); const maxDate = issue.target_date ? new Date(issue.target_date) : null; maxDate?.setDate(maxDate.getDate()); return ( <>
{/* state */}

State

issueOperations.update(workspaceSlug, projectId, issueId, { state_id: val })} projectId={projectId?.toString() ?? ""} disabled={disabled} buttonVariant="background-with-text" />
{/* assignee */}

Assignees

issueOperations.update(workspaceSlug, projectId, issueId, { assignee_ids: val })} disabled={disabled} projectId={projectId?.toString() ?? ""} placeholder="Assignees" multiple buttonVariant={issue?.assignee_ids?.length > 0 ? "transparent-without-text" : "background-with-text"} buttonClassName={issue?.assignee_ids?.length > 0 ? "hover:bg-transparent px-0" : ""} />
{/* priority */}

Priority

issueOperations.update(workspaceSlug, projectId, issueId, { priority: val })} disabled={disabled} buttonVariant="background-with-text" />
{/* estimate */} {isEstimateEnabled && (

Estimate

issueOperations.update(workspaceSlug, projectId, issueId, { estimate_point: val })} projectId={projectId} disabled={disabled} buttonVariant="background-with-text" />
)} {/* start date */}

Start date

issueOperations.update(workspaceSlug, projectId, issueId, { start_date: val })} className="border-none bg-custom-background-80" maxDate={maxDate ?? undefined} disabled={disabled} />
{/* due date */}

Due date

issueOperations.update(workspaceSlug, projectId, issueId, { target_date: val })} className="border-none bg-custom-background-80" minDate={minDate ?? undefined} disabled={disabled} />
{/* parent */}

Parent

{projectDetails?.cycle_view && (

Cycle

)} {projectDetails?.module_view && (

Module

)}

Label

); });