Вы не можете выбрать более 25 тем Темы должны начинаться с буквы или цифры, могут содержать дефисы(-) и должны содержать не более 35 символов.

103 строки
3.0 KiB

  1. "use client";
  2. import Stack from "@mui/material/Stack";
  3. import Box from "@mui/material/Box";
  4. import Card from "@mui/material/Card";
  5. import CardContent from "@mui/material/CardContent";
  6. import FormControl from "@mui/material/FormControl";
  7. import Grid from "@mui/material/Grid";
  8. import InputLabel from "@mui/material/InputLabel";
  9. import MenuItem from "@mui/material/MenuItem";
  10. import Select from "@mui/material/Select";
  11. import TextField from "@mui/material/TextField";
  12. import Typography from "@mui/material/Typography";
  13. import { useTranslation } from "react-i18next";
  14. import { InvoiceResult } from "@/app/api/invoices";
  15. import { useFormContext } from "react-hook-form";
  16. import { timestampToDateString } from "@/app/utils/formatUtil";
  17. interface Props {
  18. projectDetails: InvoiceResult
  19. }
  20. const ProjectDetails: React.FC<Props> = ({
  21. projectDetails,
  22. }) => {
  23. const { t } = useTranslation();
  24. const {
  25. register,
  26. formState: { errors },
  27. control,
  28. setValue,
  29. getValues,
  30. } = useFormContext<InvoiceResult>();
  31. return (
  32. <Card>
  33. <CardContent component={Stack} spacing={4}>
  34. <Box>
  35. <Typography variant="overline" display="block" marginBlockEnd={1}>
  36. {t("Project Details")}
  37. </Typography>
  38. <Grid container spacing={2} columns={{ xs: 6, sm: 12 }}>
  39. <Grid item xs={6}>
  40. <TextField
  41. label={t("Poject code")}
  42. fullWidth
  43. disabled
  44. defaultValue={projectDetails.projectCode}
  45. />
  46. </Grid>
  47. <Grid item xs={6}>
  48. <TextField
  49. label={t("Project name")}
  50. fullWidth
  51. disabled
  52. defaultValue={projectDetails.projectName}
  53. />
  54. </Grid>
  55. <Grid item xs={6}>
  56. <TextField
  57. label={t("Stage")}
  58. fullWidth
  59. disabled
  60. defaultValue={projectDetails.stage}
  61. />
  62. </Grid>
  63. <Grid item xs={6}>
  64. <TextField
  65. label={t("Payment milestone date")}
  66. fullWidth
  67. disabled
  68. defaultValue={projectDetails.paymentMilestoneDate}
  69. />
  70. </Grid>
  71. <Grid item xs={6}>
  72. <TextField
  73. label={t("Coming payment milestone")}
  74. fullWidth
  75. disabled
  76. defaultValue={projectDetails.comingPaymentMileStone}
  77. />
  78. </Grid>
  79. <Grid item xs={6}>
  80. <TextField
  81. label={t("Unbilled Hours")}
  82. fullWidth
  83. disabled
  84. defaultValue={projectDetails.unbilledHours}
  85. />
  86. </Grid>
  87. </Grid>
  88. </Box>
  89. {/* <CardActions sx={{ justifyContent: "flex-end" }}>
  90. <Button variant="text" startIcon={<RestartAlt />}>
  91. {t("Reset")}
  92. </Button>
  93. </CardActions> */}
  94. </CardContent>
  95. </Card>
  96. );
  97. };
  98. export default ProjectDetails;