You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 

54 lines
1.6 KiB

  1. "use client";
  2. import Check from "@mui/icons-material/Check";
  3. import Close from "@mui/icons-material/Close";
  4. import Button from "@mui/material/Button";
  5. import Stack from "@mui/material/Stack";
  6. import Tab from "@mui/material/Tab";
  7. import Tabs, { TabsProps } from "@mui/material/Tabs";
  8. import { useRouter } from "next/navigation";
  9. import React, { useCallback, useState } from "react";
  10. import { useTranslation } from "react-i18next";
  11. import ProjectClientDetails from "./ProjectClientDetails";
  12. import TaskSetup from "./TaskSetup";
  13. const CreateProject: React.FC = () => {
  14. const [tabIndex, setTabIndex] = useState(0);
  15. const { t } = useTranslation();
  16. const router = useRouter();
  17. const handleCancel = () => {
  18. router.back();
  19. };
  20. const handleTabChange = useCallback<NonNullable<TabsProps["onChange"]>>(
  21. (_e, newValue) => {
  22. setTabIndex(newValue);
  23. },
  24. [],
  25. );
  26. return (
  27. <>
  28. <Tabs value={tabIndex} onChange={handleTabChange} variant="scrollable">
  29. <Tab label={t("Project and Client Details")} />
  30. <Tab label={t("Project Task Setup")} />
  31. <Tab label={t("Staff Allocation")} />
  32. <Tab label={t("Resource and Milestone")} />
  33. </Tabs>
  34. {tabIndex === 0 && <ProjectClientDetails />}
  35. {tabIndex === 1 && <TaskSetup />}
  36. <Stack direction="row" justifyContent="flex-end" gap={1}>
  37. <Button variant="outlined" startIcon={<Close />} onClick={handleCancel}>
  38. {t("Cancel")}
  39. </Button>
  40. <Button variant="contained" startIcon={<Check />}>
  41. {t("Confirm")}
  42. </Button>
  43. </Stack>
  44. </>
  45. );
  46. };
  47. export default CreateProject;