import { FC } from "react"; import { useRouter } from "next/router"; import { observer } from "mobx-react-lite"; import { CalendarDays, Signal, Tag, Triangle, LayoutPanelTop } from "lucide-react"; // hooks import { useProject, useUser } from "hooks/store"; // ui icons import { DiceIcon, DoubleCircleIcon, UserGroupIcon, ContrastIcon } from "@plane/ui"; import { IssueLinkRoot, IssueCycleSelect, IssueModuleSelect, IssueParentSelect, IssueLabel } from "components/issues"; import { EstimateDropdown, PriorityDropdown, ProjectMemberDropdown, StateDropdown } from "components/dropdowns"; // components import { CustomDatePicker } from "components/ui"; // types import { TIssue, TIssuePriorities } from "@plane/types"; // constants // import { EUserProjectRoles } from "constants/project"; interface IPeekOverviewProperties { issue: TIssue; issueUpdate: (issue: Partial) => void; disableUserActions: boolean; issueOperations: any; } export const PeekOverviewProperties: FC = observer((props) => { const { issue, issueUpdate, disableUserActions, issueOperations } = props; // store hooks const { membership: { currentProjectRole }, } = useUser(); const { getProjectById } = useProject(); // router const router = useRouter(); const { workspaceSlug, projectId } = router.query; const uneditable = currentProjectRole ? [5, 10].includes(currentProjectRole) : false; // const isAllowed = !!currentProjectRole && currentProjectRole >= EUserProjectRoles.MEMBER; const handleState = (_state: string) => { issueUpdate({ ...issue, state_id: _state }); }; const handlePriority = (_priority: TIssuePriorities) => { issueUpdate({ ...issue, priority: _priority }); }; const handleAssignee = (_assignees: string[]) => { issueUpdate({ ...issue, assignee_ids: _assignees }); }; const handleEstimate = (_estimate: number | null) => { issueUpdate({ ...issue, estimate_point: _estimate }); }; const handleStartDate = (_startDate: string | null) => { issueUpdate({ ...issue, start_date: _startDate || undefined }); }; const handleTargetDate = (_targetDate: string | null) => { issueUpdate({ ...issue, target_date: _targetDate || undefined }); }; 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

{/* assignee */}

Assignees

0 ? "transparent-without-text" : "background-with-text"} buttonClassName={issue.assignee_ids?.length > 0 ? "hover:bg-transparent px-0" : ""} />
{/* priority */}

Priority

{/* estimate */} {isEstimateEnabled && (

Estimate

)} {/* start date */}

Start date

{/* due date */}

Due date

{/* parent */}

Parent

{projectDetails?.cycle_view && (

Cycle

)} {projectDetails?.module_view && (

Module

)}

Label

); });