import { FC } from "react"; import useSWR from "swr"; import Link from "next/link"; import { useRouter } from "next/router"; import { observer } from "mobx-react-lite"; // hooks import { useMobxStore } from "lib/mobx/store-provider"; // ui import { Breadcrumbs, BreadcrumbItem } from "@plane/ui"; // helper import { truncateText } from "helpers/string.helper"; // types import { IIssue } from "types"; // constants import { ISSUE_DETAILS } from "constants/fetch-keys"; // services import { IssueArchiveService } from "services/issue"; const issueArchiveService = new IssueArchiveService(); export const ProjectArchivedIssueDetailsHeader: FC = observer(() => { const router = useRouter(); const { workspaceSlug, projectId, archivedIssueId } = router.query; const { project: projectStore } = useMobxStore(); const projectDetails = workspaceSlug && projectId ? projectStore.getProjectById(workspaceSlug.toString(), projectId.toString()) : undefined; const { data: issueDetails } = useSWR( workspaceSlug && projectId && archivedIssueId ? ISSUE_DETAILS(archivedIssueId as string) : null, workspaceSlug && projectId && archivedIssueId ? () => issueArchiveService.retrieveArchivedIssue( workspaceSlug as string, projectId as string, archivedIssueId as string ) : null ); return (
router.back()}>

{`${truncateText( issueDetails?.project_detail.name ?? "Project", 32 )} Issues`}

); });