import { FC } from "react"; import { observer } from "mobx-react-lite"; import { useRouter } from "next/router"; // ui import { ArchiveIcon, Breadcrumbs, Tooltip } from "@plane/ui"; // components import { BreadcrumbLink, Logo } from "@/components/common"; // constants import { PROJECT_ARCHIVES_BREADCRUMB_LIST } from "@/constants/archives"; import { EIssuesStoreType } from "@/constants/issue"; // hooks import { useIssues, useProject } from "@/hooks/store"; import { usePlatformOS } from "@/hooks/use-platform-os"; export const ProjectArchivesHeader: FC = observer(() => { // router const router = useRouter(); const { workspaceSlug, projectId } = router.query; const activeTab = router.pathname.split("/").pop(); // store hooks const { issuesFilter: { issueFilters }, } = useIssues(EIssuesStoreType.ARCHIVED); const { currentProjectDetails } = useProject(); // hooks const { isMobile } = usePlatformOS(); const issueCount = currentProjectDetails ? !issueFilters?.displayFilters?.sub_issue && currentProjectDetails.archived_sub_issues ? currentProjectDetails.archived_issues - currentProjectDetails.archived_sub_issues : currentProjectDetails.archived_issues : undefined; const activeTabBreadcrumbDetail = PROJECT_ARCHIVES_BREADCRUMB_LIST[activeTab as keyof typeof PROJECT_ARCHIVES_BREADCRUMB_LIST]; return (
) } /> } /> } /> } /> {activeTabBreadcrumbDetail && ( } /> } /> )} {activeTab === "issues" && issueCount && issueCount > 0 ? ( 1 ? "issues" : "issue"} in project's archived`} position="bottom" > {issueCount} ) : null}
); });