lavoce #27

Merged
bragaz_rexita merged 42 commits from lavoce into main 2025-12-22 09:28:35 +00:00
Showing only changes of commit fb790e5e37 - Show all commits

View File

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