repair: error code brand-device

This commit is contained in:
2025-12-12 16:54:52 +07:00
parent ea3adf40cc
commit fb790e5e37

View File

@@ -15,8 +15,8 @@ const ErrorCodeForm = ({
onErrorCodeIconRemove,
isEdit = false,
}) => {
const [statusValue, setStatusValue] = useState(true);
const [currentIcon, setCurrentIcon] = useState(null);
const statusWatch = Form.useWatch('status', errorCodeForm) ?? true;
useEffect(() => {
if (errorCodeIcon && typeof errorCodeIcon === 'object' && Object.keys(errorCodeIcon).length > 0) {
@@ -207,14 +207,13 @@ const ErrorCodeForm = ({
valuePropName="checked"
>
<div style={{ display: 'flex', alignItems: 'center' }}>
<Switch
defaultChecked={true}
onChange={(checked) => {
setStatusValue(checked);
}}
/>
<Form.Item name="status" valuePropName="checked" noStyle>
<Switch
disabled={isErrorCodeFormReadOnly}
/>
</Form.Item>
<Text style={{ marginLeft: 8 }}>
{statusValue ? 'Active' : 'Inactive'}
{statusWatch ? 'Active' : 'Inactive'}
</Text>
</div>
</Form.Item>