"use client"; import { Card, CardContent, Stack, TextField, Typography, Box, InputAdornment, } from "@mui/material"; import { useFormContext, Controller } from "react-hook-form"; import { useTranslation } from "react-i18next"; import { WarehouseInputs } from "@/app/api/warehouse/actions"; const WarehouseDetail: React.FC = () => { const { t } = useTranslation("warehouse"); const { register, control, formState: { errors }, } = useFormContext(); return ( {t("Warehouse Detail")} {/* 樓層 field with F inside on the right - F is automatically generated */} ( F ), }} onChange={(e) => { // Automatically remove "F" if user tries to type it (F is auto-generated) const value = e.target.value.replace(/F/gi, "").trim(); field.onChange(value); }} error={Boolean(errors.store_id)} helperText={errors.store_id?.message} /> )} /> - {/* 倉庫 field */} ( )} /> - {/* 區域 field */} ( )} /> - {/* 儲位 field */} ( )} /> {/* stockTakeSection field in the same row */} ); }; export default WarehouseDetail;