now displayed cancel and submit button at initially - bug643
This commit is contained in:
parent
20c9dca759
commit
afac84dc9b
@ -8,8 +8,10 @@ import { useSelector } from "react-redux";
|
||||
|
||||
const workAreaSchema = z.object({
|
||||
id: z.string().optional(),
|
||||
buildingId: z.string().min(1, "Building is required"),
|
||||
floorId: z.string().min(1, "Floor is required"),
|
||||
buildingId: z.string().refine((val) => val !== "0", {
|
||||
message: "Building is required",
|
||||
}),
|
||||
floorId: z.string().refine((val)=>val !== "0",{message:"Floor is required"}),
|
||||
areaName: z.string().min(3, "Work Area Name must be at least 3 characters"),
|
||||
});
|
||||
|
||||
@ -183,8 +185,9 @@ const WorkAreaModel = ({ project, onSubmit, onClose }) => {
|
||||
<p className="danger-text">{errors.areaName.message}</p>
|
||||
)}
|
||||
</div>
|
||||
|
||||
<div className="col-12 text-center">
|
||||
</>
|
||||
)}
|
||||
<div className="col-12 text-center">
|
||||
<button type="submit" className="btn btn-sm btn-primary me-3" disabled={isPending}>
|
||||
{isPending ? "Please Wait.." : watchWorkAreaId === "0" ? "Add Work Area" : "Update Work Area"}
|
||||
</button>
|
||||
@ -192,8 +195,6 @@ const WorkAreaModel = ({ project, onSubmit, onClose }) => {
|
||||
Cancel
|
||||
</button>
|
||||
</div>
|
||||
</>
|
||||
)}
|
||||
</form>
|
||||
);
|
||||
};
|
||||
|
Loading…
x
Reference in New Issue
Block a user