From cf1ccb0fd0641ddcf94e199b2c62f0198e142fa6 Mon Sep 17 00:00:00 2001 From: Antony Kurniawan Date: Fri, 12 Dec 2025 16:55:05 +0700 Subject: [PATCH] repair: sollution brand-device --- .../brandDevice/component/SolutionField.jsx | 36 +++++++++++-------- 1 file changed, 22 insertions(+), 14 deletions(-) diff --git a/src/pages/master/brandDevice/component/SolutionField.jsx b/src/pages/master/brandDevice/component/SolutionField.jsx index 2aad465..d0746b5 100644 --- a/src/pages/master/brandDevice/component/SolutionField.jsx +++ b/src/pages/master/brandDevice/component/SolutionField.jsx @@ -1,5 +1,5 @@ import React, { useState } from 'react'; -import { Form, Input, Button, Switch, Radio, Typography, Space, Card } from 'antd'; +import { Form, Input, Button, Switch, Radio, Typography, Space, Card, ConfigProvider } from 'antd'; import { DeleteOutlined, EyeOutlined, FileOutlined } from '@ant-design/icons'; import FileUploadHandler from './FileUploadHandler'; import { NotifAlert } from '../../../../components/Global/ToastNotif'; @@ -43,6 +43,7 @@ const SolutionFieldNew = ({ const typeValue = Form.useWatch(['solution_items', fieldKey, 'type'], form); const textValue = Form.useWatch(['solution_items', fieldKey, 'text'], form); const fileNameValue = Form.useWatch(['solution_items', fieldKey, 'fileName'], form); + const statusValue = Form.useWatch(['solution_items', fieldKey, 'status'], form) ?? true; const pathSolution = Form.useWatch(['solution_items', fieldKey, 'path_solution'], form); @@ -373,13 +374,23 @@ const SolutionFieldNew = ({ }; return ( -
+ +
{ onStatusChange(fieldKey, checked); }} - defaultChecked={solutionStatus !== false} - style={{ - backgroundColor: solutionStatus !== false ? '#23A55A' : '#bfbfbf' - }} /> - {solutionStatus !== false ? 'Active' : 'Inactive'} + {statusValue ? 'Active' : 'Inactive'}
@@ -494,7 +501,8 @@ const SolutionFieldNew = ({ {renderSolutionContent()} -
+
+ ); };