// next import type { NextPage } from "next"; import useSWR from "swr"; import { useRouter } from "next/router"; // layouts import AppLayout from "layouts/app-layout"; // hoc import withAuth from "lib/hoc/withAuthWrapper"; // services import modulesService from "lib/services/modules.service"; // hooks import useUser from "lib/hooks/useUser"; // ui import { BreadcrumbItem, Breadcrumbs, EmptySpace, EmptySpaceItem, HeaderButton, Spinner } from "ui"; // icons import { PlusIcon, RectangleGroupIcon } from "@heroicons/react/24/outline"; // types import { IModule } from "types/modules"; // fetch-keys import { MODULE_LIST } from "constants/fetch-keys"; const ProjectModules: NextPage = () => { const { activeWorkspace, activeProject } = useUser(); const router = useRouter(); const { projectId } = router.query; const { data: modules } = useSWR( activeWorkspace && projectId ? MODULE_LIST(projectId as string) : null, activeWorkspace && projectId ? () => modulesService.getModules(activeWorkspace.slug, projectId as string) : null ); console.log(modules); return ( } right={ { const e = new KeyboardEvent("keydown", { ctrlKey: true, key: "m", }); document.dispatchEvent(e); }} /> } > {modules ? ( modules.length > 0 ? (
{modules.map((module) => (

{module.name}

{module.description}

))}
) : (
Use
Ctrl/Command + Q
{" "} shortcut to create a new cycle } Icon={PlusIcon} action={() => { return; }} />
) ) : (
)}
); }; export default withAuth(ProjectModules);