import { FC } from "react"; import { observer } from "mobx-react"; import Link from "next/link"; import { useRouter } from "next/router"; // constants import { ARCHIVES_TAB_LIST } from "@/constants/archives"; // hooks import { useProject } from "@/hooks/store"; export const ArchiveTabsList: FC = observer(() => { // router const router = useRouter(); const { workspaceSlug, projectId } = router.query; const activeTab = router.pathname.split("/").pop(); // store hooks const { getProjectById } = useProject(); // derived values if (!projectId) return null; const projectDetails = getProjectById(projectId?.toString()); if (!projectDetails) return null; return ( <> {ARCHIVES_TAB_LIST.map( (tab) => tab.shouldRender(projectDetails) && ( {tab.label} ) )} ); });