import React from "react"; import { observer } from "mobx-react"; import { useRouter } from "next/router"; import { CircleCheck, CircleX, ChevronDown, ChevronUp, Clock, ExternalLink, FileStack, Link, Trash2, PanelLeft, } from "lucide-react"; import { CustomMenu } from "@plane/ui"; // components import { InboxIssueStatus } from "@/components/inbox"; import { IssueUpdateStatus } from "@/components/issues"; // helpers import { cn } from "@/helpers/common.helper"; // store types import type { IInboxIssueStore } from "@/store/inbox/inbox-issue.store"; type Props = { workspaceSlug: string; inboxIssue: IInboxIssueStore | undefined; isSubmitting: "submitting" | "submitted" | "saved"; handleInboxIssueNavigation: (direction: "next" | "prev") => void; canMarkAsAccepted: boolean; canMarkAsDeclined: boolean; isAcceptedOrDeclined: boolean | undefined; canMarkAsDuplicate: boolean; canDelete: boolean; setAcceptIssueModal: (value: boolean) => void; setDeclineIssueModal: (value: boolean) => void; setDeleteIssueModal: (value: boolean) => void; setIsSnoozeDateModalOpen: (value: boolean) => void; setSelectDuplicateIssue: (value: boolean) => void; handleCopyIssueLink: () => void; toggleMobileSidebar: boolean; setToggleMobileSidebar: (value: boolean) => void; }; export const InboxIssueActionsMobileHeader: React.FC = observer((props) => { const { inboxIssue, isSubmitting, handleInboxIssueNavigation, canMarkAsAccepted, canMarkAsDeclined, canDelete, canMarkAsDuplicate, isAcceptedOrDeclined, workspaceSlug, setAcceptIssueModal, setDeclineIssueModal, setDeleteIssueModal, setIsSnoozeDateModalOpen, setSelectDuplicateIssue, handleCopyIssueLink, toggleMobileSidebar, setToggleMobileSidebar, } = props; const router = useRouter(); const issue = inboxIssue?.issue; const currentInboxIssueId = issue?.id; if (!issue || !inboxIssue) return null; return (
setToggleMobileSidebar(!toggleMobileSidebar)} className={cn( "w-4 h-4 flex-shrink-0 mr-2", toggleMobileSidebar ? "text-custom-primary-100" : "text-custom-text-200" )} />
{isAcceptedOrDeclined && (
Copy issue link
)} {isAcceptedOrDeclined && ( router.push(`/${workspaceSlug}/projects/${issue?.project_id}/issues/${currentInboxIssueId}`) } >
Open issue
)} {canMarkAsAccepted && !isAcceptedOrDeclined && ( setIsSnoozeDateModalOpen(true)}>
Snooze
)} {canMarkAsDuplicate && !isAcceptedOrDeclined && ( setSelectDuplicateIssue(true)}>
Mark as duplicate
)} {canMarkAsAccepted && ( setAcceptIssueModal(true)}>
Accept
)} {canMarkAsDeclined && ( setDeclineIssueModal(true)}>
Decline
)} {canDelete && !isAcceptedOrDeclined && ( setDeleteIssueModal(true)}>
Delete
)}
); });