import React, { useEffect } from "react"; import { useRouter } from "next/router"; // mobx import { observer } from "mobx-react-lite"; import { useMobxStore } from "lib/mobx/store-provider"; // components import { CycleDetailsSidebar } from "./sidebar"; type Props = { projectId: string; workspaceSlug: string; }; export const CyclePeekOverview: React.FC = observer(({ projectId, workspaceSlug }) => { const router = useRouter(); const { peekCycle } = router.query; const ref = React.useRef(null); const { cycle: cycleStore } = useMobxStore(); const { fetchCycleWithId } = cycleStore; const handleClose = () => { delete router.query.peekCycle; router.push({ pathname: router.pathname, query: { ...router.query }, }); }; useEffect(() => { if (!peekCycle) return; fetchCycleWithId(workspaceSlug, projectId, peekCycle.toString()); }, [fetchCycleWithId, peekCycle, projectId, workspaceSlug]); return ( <> {peekCycle && (
)} ); });