From a3666dbf41b1b6872772db85675772978c98f79d Mon Sep 17 00:00:00 2001 From: Rafiafrzl Date: Fri, 10 Oct 2025 14:40:41 +0700 Subject: [PATCH] add status toggle switch to DetailBrandDevice and update ListBrandDevice --- .../component/DetailBrandDevice.jsx | 53 +++++++++++++------ .../brandDevice/component/ListBrandDevice.jsx | 2 +- 2 files changed, 38 insertions(+), 17 deletions(-) diff --git a/src/pages/master/brandDevice/component/DetailBrandDevice.jsx b/src/pages/master/brandDevice/component/DetailBrandDevice.jsx index 3507e9a..137bf27 100644 --- a/src/pages/master/brandDevice/component/DetailBrandDevice.jsx +++ b/src/pages/master/brandDevice/component/DetailBrandDevice.jsx @@ -1,5 +1,5 @@ import { useEffect, useState } from 'react'; -import { Modal, Input, Typography, Button, ConfigProvider, Select } from 'antd'; +import { Modal, Input, Divider, Typography, Switch, Button, ConfigProvider, Select } from 'antd'; import { NotifAlert, NotifOk } from '../../../../components/Global/ToastNotif'; const { Text } = Typography; @@ -143,6 +143,14 @@ const DetailBrandDevice = (props) => { }); }; + const handleStatusToggle = (event) => { + const isChecked = event; + setFormData({ + ...FormData, + status: isChecked ? true : false, + }); + }; + useEffect(() => { const token = localStorage.getItem('token'); if (token) { @@ -212,6 +220,34 @@ const DetailBrandDevice = (props) => { > {FormData && (
+
+
+ Status +
+
+
+ +
+
+ {FormData.status === true ? 'Active' : 'Inactive'} +
+
+
+ -
- Status - * -