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