FPSMS-frontend
選択できるのは25トピックまでです。 トピックは、先頭が英数字で、英数字とダッシュ('-')を使用した35文字以内のものにしてください。
 
 
 

84 行
3.3 KiB

  1. import { JoDetail } from "@/app/api/jo";
  2. import { decimalFormatter, integerFormatter } from "@/app/utils/formatUtil";
  3. import { Box, Card, CardContent, Grid, Stack, TextField } from "@mui/material";
  4. import { upperFirst } from "lodash";
  5. import { useFormContext } from "react-hook-form";
  6. import { useTranslation } from "react-i18next";
  7. type Props = {
  8. };
  9. const InfoCard: React.FC<Props> = ({
  10. }) => {
  11. const { t } = useTranslation();
  12. const { control, getValues, register, watch } = useFormContext<JoDetail>();
  13. return (
  14. <Card sx={{ display: "block" }}>
  15. <CardContent component={Stack} spacing={4}>
  16. <Box>
  17. <Grid container spacing={2} columns={{ xs: 6, sm: 12 }}>
  18. <Grid item xs={6}>
  19. <TextField
  20. // {
  21. // ...register("status")
  22. // }
  23. label={t("Status")}
  24. fullWidth
  25. disabled={true}
  26. value={`${t(upperFirst(watch("status")))}`}
  27. />
  28. </Grid>
  29. <Grid item xs={6}/>
  30. <Grid item xs={6}>
  31. <TextField
  32. {
  33. ...register("code")
  34. }
  35. label={t("Code")}
  36. fullWidth
  37. disabled={true}
  38. />
  39. </Grid>
  40. <Grid item xs={6}>
  41. <TextField
  42. {
  43. ...register("name")
  44. }
  45. label={t("Name")}
  46. fullWidth
  47. disabled={true}
  48. />
  49. </Grid>
  50. <Grid item xs={6}>
  51. <TextField
  52. // {
  53. // ...register("name")
  54. // }
  55. label={t("Req. Qty")}
  56. fullWidth
  57. disabled={true}
  58. defaultValue={`${integerFormatter.format(watch("reqQty"))}`}
  59. />
  60. </Grid>
  61. <Grid item xs={6}>
  62. <TextField
  63. {
  64. ...register("outputQtyUom")
  65. }
  66. label={t("UoM")}
  67. fullWidth
  68. disabled={true}
  69. />
  70. </Grid>
  71. </Grid>
  72. </Box>
  73. </CardContent>
  74. </Card>
  75. )
  76. }
  77. export default InfoCard;