import React, { useEffect } from "react"; import { observer } from "mobx-react-lite"; import { useRouter } from "next/router"; // hooks import { useModule } from "@/hooks/store"; // components import { ModuleDetailsSidebar } from "./sidebar"; type Props = { projectId: string; workspaceSlug: string; }; export const ModulePeekOverview: React.FC = observer(({ projectId, workspaceSlug }) => { // router const router = useRouter(); const { peekModule } = router.query; // refs const ref = React.useRef(null); // store hooks const { fetchModuleDetails } = useModule(); const handleClose = () => { delete router.query.peekModule; router.push({ pathname: router.pathname, query: { ...router.query }, }); }; useEffect(() => { if (!peekModule) return; fetchModuleDetails(workspaceSlug, projectId, peekModule.toString()); }, [fetchModuleDetails, peekModule, projectId, workspaceSlug]); return ( <> {peekModule && (
)} ); });