fix is_active error code ft vinix

This commit is contained in:
2025-10-30 15:15:26 +07:00
parent 114ef96de8
commit 4544e33d01
4 changed files with 26 additions and 36 deletions

View File

@@ -4,6 +4,8 @@ import { Form, Input, Row, Col, Typography, Switch } from 'antd';
const { Text } = Typography;
const BrandForm = ({ form, formData, onValuesChange, isEdit = false }) => {
const isActive = Form.useWatch('is_active', form) ?? formData.is_active ?? true;
return (
<Form
layout="vertical"
@@ -15,12 +17,11 @@ const BrandForm = ({ form, formData, onValuesChange, isEdit = false }) => {
<div style={{ display: 'flex', alignItems: 'center' }}>
<Form.Item name="is_active" valuePropName="checked" noStyle>
<Switch
checked={formData.is_active}
style={{ backgroundColor: formData.is_active ? '#23A55A' : '#bfbfbf' }}
style={{ backgroundColor: isActive ? '#23A55A' : '#bfbfbf' }}
/>
</Form.Item>
<Text style={{ marginLeft: 8 }}>
{formData.is_active ? 'Running' : 'Offline'}
{isActive ? 'Running' : 'Offline'}
</Text>
</div>
</Form.Item>