FPSMS-frontend
您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符
 
 
 

60 行
1.9 KiB

  1. "use client";
  2. import Grid from "@mui/material/Grid";
  3. import Paper from "@mui/material/Paper";
  4. import { TFunction } from "i18next";
  5. import { useTranslation } from "react-i18next";
  6. import PageTitle from "../PageTitle/PageTitle";
  7. import DashboardTabButton from "./DashboardTabButton";
  8. import { ThemeProvider } from "@mui/material/styles";
  9. import theme from "../../theme";
  10. import Tabs, { TabsProps } from "@mui/material/Tabs";
  11. import Tab from "@mui/material/Tab";
  12. import React, { useCallback, useState } from "react";
  13. import { useRouter } from "next/navigation";
  14. import ProgressByClient from "./ProgressByClient";
  15. import ProgressByClientSearch from "@/components/ProgressByClientSearch";
  16. import { Suspense } from "react";
  17. import { getSession } from "next-auth/react";
  18. type Props = {
  19. abilities: string[]
  20. }
  21. const DashboardPage: React.FC<Props> = ({
  22. abilities
  23. }) => {
  24. const [tabIndex, setTabIndex] = useState(0);
  25. const { t } = useTranslation("dashboard");
  26. const router = useRouter();
  27. window.localStorage.setItem("abilities", JSON.stringify(abilities))
  28. const handleCancel = () => {
  29. router.back();
  30. };
  31. const handleTabChange = useCallback<NonNullable<TabsProps["onChange"]>>(
  32. (_e, newValue) => {
  33. setTabIndex(newValue);
  34. },
  35. [],
  36. );
  37. return (
  38. <ThemeProvider theme={theme}>
  39. <Tabs value={tabIndex} onChange={handleTabChange} variant="scrollable">
  40. <Tab label="Project Financial Summary" />
  41. {/* <Tab label="Project Cash Flow" />
  42. <Tab label="Project Progress by Client" />
  43. <Tab label="Project Resource Utilization" />
  44. <Tab label="Staff Utilization" /> */}
  45. </Tabs>
  46. {tabIndex === 2 && <ProgressByClient />}
  47. {/* <Grid container height="100vh" style={{ backgroundColor: theme.palette.background.default}}>
  48. <Grid item sm>
  49. <PageTitle BigTitle={"Dashboards"}/>
  50. <DashboardTabButton/>
  51. </Grid>
  52. </Grid> */}
  53. </ThemeProvider>
  54. );
  55. };
  56. export default DashboardPage;