From 03c4988ff125b3c4900664feac18f05ef276c281 Mon Sep 17 00:00:00 2001 From: Md Asif Date: Tue, 24 Dec 2024 01:06:10 +0530 Subject: [PATCH] refactor: streamline layout and error handling in CabinetCreation component --- src/pages/CabinetCreation.jsx | 182 +++++++++++++++++----------------- 1 file changed, 89 insertions(+), 93 deletions(-) diff --git a/src/pages/CabinetCreation.jsx b/src/pages/CabinetCreation.jsx index 853a780..5245fbb 100644 --- a/src/pages/CabinetCreation.jsx +++ b/src/pages/CabinetCreation.jsx @@ -36,103 +36,99 @@ function CabinetCreation() { }); }; return ( - - -
-
- -
- - setCabinetId({ - id: e.target.value.toUpperCase(), - valid: true, - }) - } - type="text" - maxLength={6} - /> - - {!cabinetId.valid && ( - - Invalid Cabinet Id - - )} - -
-
-
- -
- - setCabinetKeyId({ - id: e.target.value.toUpperCase(), - valid: true, - }) - } - type="text" - maxLength={6} - /> - {!cabinetKeyId.valid && ( -
- Invalid Key Id -
+ +
+
+ +
+ -
-
- -
- - setNoOfLockers({ number: e.target.value, valid: true }) - } - type="number" - /> - {!noOfLockers.valid && ( -
- Invalid Number of Lockers -
+ onChange={(e) => + setCabinetId({ + id: e.target.value.toUpperCase(), + valid: true, + }) + } + type="text" + maxLength={6} + /> + + {!cabinetId.valid && ( + + Invalid Cabinet Id + )} -
+
-
+