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.
 
 

75 lines
2.4 KiB

  1. "use client";
  2. import Card from "@mui/material/Card";
  3. import CardContent from "@mui/material/CardContent";
  4. import Grid from "@mui/material/Grid";
  5. import TextField from "@mui/material/TextField";
  6. import Typography from "@mui/material/Typography";
  7. import { useTranslation } from "react-i18next";
  8. import TransferList from "../TransferList";
  9. import Button from "@mui/material/Button";
  10. import Check from "@mui/icons-material/Check";
  11. import Close from "@mui/icons-material/Close";
  12. import { useRouter } from "next/navigation";
  13. import React from "react";
  14. import Stack from "@mui/material/Stack";
  15. const CreateTaskTemplate = () => {
  16. const { t } = useTranslation();
  17. const router = useRouter();
  18. const handleCancel = () => {
  19. router.back();
  20. };
  21. return (
  22. <>
  23. <Card>
  24. <CardContent sx={{ display: "flex", flexDirection: "column", gap: 1 }}>
  25. <Typography variant="overline">{t("Task List Setup")}</Typography>
  26. <Grid
  27. container
  28. spacing={2}
  29. columns={{ xs: 6, sm: 12 }}
  30. marginBlockEnd={1}
  31. >
  32. <Grid item xs={6}>
  33. <TextField label={t("Task Template Code")} fullWidth />
  34. </Grid>
  35. <Grid item xs={6}>
  36. <TextField label={t("Task Template Name")} fullWidth />
  37. </Grid>
  38. </Grid>
  39. <TransferList
  40. allItems={[
  41. { id: "1", label: "Task 1: Super long task name that will overflow to the next line" },
  42. { id: "2", label: "Task 2" },
  43. { id: "3", label: "Task 3" },
  44. { id: "4", label: "Task 4" },
  45. { id: "5", label: "Task 5" },
  46. { id: "6", label: "Task 6" },
  47. { id: "7", label: "Task 7" },
  48. { id: "8", label: "Task 8" },
  49. { id: "9", label: "Task 9" },
  50. ]}
  51. initiallySelectedItems={[]}
  52. onChange={() => {}}
  53. allItemsLabel={t("Task Pool")}
  54. selectedItemsLabel={t("Task List Template")}
  55. />
  56. </CardContent>
  57. </Card>
  58. <Stack direction="row" justifyContent="flex-end" gap={1}>
  59. <Button variant="outlined" startIcon={<Close />} onClick={handleCancel}>
  60. {t("Cancel")}
  61. </Button>
  62. <Button variant="contained" startIcon={<Check />}>
  63. {t("Confirm")}
  64. </Button>
  65. </Stack>
  66. </>
  67. );
  68. };
  69. export default CreateTaskTemplate;