// ui import { StateGroupIcon, TOAST_TYPE, setToast } from "@plane/ui"; // icons import { Icon } from "@/components/ui"; // constants import { issueGroupFilter, issuePriorityFilter } from "@/constants/issue"; // helpers import { renderFullDate } from "@/helpers/date-time.helper"; import { copyTextToClipboard, addSpaceIfCamelCase } from "@/helpers/string.helper"; // types import { IIssue, IPeekMode } from "@/types/issue"; // components import { dueDateIconDetails } from "../board-views/block-due-date"; type Props = { issueDetails: IIssue; mode?: IPeekMode; }; export const PeekOverviewIssueProperties: React.FC = ({ issueDetails, mode }) => { const state = issueDetails.state_detail; const stateGroup = issueGroupFilter(state.group); const priority = issueDetails.priority ? issuePriorityFilter(issueDetails.priority) : null; const dueDateIcon = dueDateIconDetails(issueDetails.target_date, state.group); const handleCopyLink = () => { const urlToCopy = window.location.href; copyTextToClipboard(urlToCopy).then(() => { setToast({ type: TOAST_TYPE.INFO, title: "Link copied!", message: "Issue link copied to clipboard", }); }); }; return (
{mode === "full" && (
{issueDetails.project_detail.identifier}-{issueDetails.sequence_id}
)}
State
{stateGroup && (
{addSpaceIfCamelCase(state?.name ?? "")}
)}
Priority
{priority && ( )} {priority?.title ?? "None"}
Due date
{issueDetails.target_date ? (
{dueDateIcon.iconName} {renderFullDate(issueDetails.target_date)}
) : ( Empty )}
); };