2023-11-02 18:27:44 +00:00
|
|
|
import { ReactElement } from "react";
|
2024-03-06 13:09:14 +00:00
|
|
|
import { observer } from "mobx-react";
|
2024-02-20 08:06:38 +00:00
|
|
|
import { useRouter } from "next/router";
|
2022-12-16 16:20:09 +00:00
|
|
|
// layouts
|
2022-12-22 16:19:46 +00:00
|
|
|
// components
|
2024-02-20 08:06:38 +00:00
|
|
|
import { PageHead } from "components/core";
|
2023-10-23 13:47:42 +00:00
|
|
|
import { ModulesListHeader } from "components/headers";
|
2024-03-06 13:09:14 +00:00
|
|
|
import { ModulesListView } from "components/modules";
|
2023-11-02 18:27:44 +00:00
|
|
|
// types
|
2024-02-20 08:06:38 +00:00
|
|
|
// hooks
|
|
|
|
import { useProject } from "hooks/store";
|
2024-03-06 13:09:14 +00:00
|
|
|
import { AppLayout } from "layouts/app-layout";
|
|
|
|
import { NextPageWithLayout } from "lib/types";
|
2023-10-23 13:47:42 +00:00
|
|
|
|
2024-02-20 08:06:38 +00:00
|
|
|
const ProjectModulesPage: NextPageWithLayout = observer(() => {
|
|
|
|
const router = useRouter();
|
|
|
|
const { projectId } = router.query;
|
|
|
|
// store
|
|
|
|
const { getProjectById } = useProject();
|
|
|
|
// derived values
|
|
|
|
const project = projectId ? getProjectById(projectId.toString()) : undefined;
|
|
|
|
const pageTitle = project?.name ? `${project?.name} - Modules` : undefined;
|
|
|
|
|
|
|
|
return (
|
|
|
|
<>
|
|
|
|
<PageHead title={pageTitle} />
|
|
|
|
<ModulesListView />
|
|
|
|
</>
|
|
|
|
);
|
|
|
|
});
|
2022-12-16 16:20:09 +00:00
|
|
|
|
2023-11-02 18:27:44 +00:00
|
|
|
ProjectModulesPage.getLayout = function getLayout(page: ReactElement) {
|
|
|
|
return (
|
|
|
|
<AppLayout header={<ModulesListHeader />} withProjectWrapper>
|
|
|
|
{page}
|
|
|
|
</AppLayout>
|
|
|
|
);
|
|
|
|
};
|
|
|
|
|
|
|
|
export default ProjectModulesPage;
|