import { FC } from "react"; import { observer } from "mobx-react"; import Link from "next/link"; import { useParams, usePathname } from "next/navigation"; // constants import { ARCHIVES_TAB_LIST } from "@/constants/archives"; // hooks import { useProject } from "@/hooks/store"; export const ArchiveTabsList: FC = observer(() => { // router const { workspaceSlug, projectId } = useParams(); const pathname = usePathname(); const activeTab = 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} ) )} ); });