feat: remove unused activeTab state and related props from ListBrandDevice component
This commit is contained in:
@@ -12,7 +12,6 @@ const IndexBrandDevice = memo(function IndexBrandDevice() {
|
||||
const navigate = useNavigate();
|
||||
const { setBreadcrumbItems } = useBreadcrumb();
|
||||
|
||||
const [activeTab, setActiveTab] = useState('brandDevice');
|
||||
const [actionMode, setActionMode] = useState('list');
|
||||
const [selectedData, setSelectedData] = useState(null);
|
||||
const [readOnly, setReadOnly] = useState(false);
|
||||
@@ -62,8 +61,6 @@ const IndexBrandDevice = memo(function IndexBrandDevice() {
|
||||
selectedData={selectedData}
|
||||
setSelectedData={setSelectedData}
|
||||
readOnly={readOnly}
|
||||
activeTab={activeTab}
|
||||
setActiveTab={setActiveTab}
|
||||
/>
|
||||
<DetailBrandDevice
|
||||
setActionMode={setMode}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import React, { memo, useState, useEffect } from 'react';
|
||||
import { Button, Col, Row, Space, Input, ConfigProvider, Card, Tag, Tabs } from 'antd';
|
||||
import { Button, Col, Row, Space, Input, ConfigProvider, Card, Tag } from 'antd';
|
||||
import {
|
||||
PlusOutlined,
|
||||
EditOutlined,
|
||||
@@ -10,7 +10,6 @@ import {
|
||||
import { NotifAlert, NotifConfirmDialog } from '../../../../components/Global/ToastNotif';
|
||||
import { useNavigate } from 'react-router-dom';
|
||||
import TableList from '../../../../components/Global/TableList';
|
||||
import ListErrorMaster from './ListErrorMaster';
|
||||
|
||||
// Dummy data
|
||||
const initialBrandDeviceData = [
|
||||
@@ -265,40 +264,9 @@ const ListBrandDevice = memo(function ListBrandDevice(props) {
|
||||
});
|
||||
};
|
||||
|
||||
const tabItems = [
|
||||
{
|
||||
key: 'brandDevice',
|
||||
label: 'Brand Device',
|
||||
},
|
||||
{
|
||||
key: 'errorMaster',
|
||||
label: 'Error Master',
|
||||
},
|
||||
];
|
||||
|
||||
return (
|
||||
<React.Fragment>
|
||||
<Card>
|
||||
<ConfigProvider
|
||||
theme={{
|
||||
components: {
|
||||
Tabs: {
|
||||
inkBarColor: '#FF8C42',
|
||||
itemActiveColor: '#FF8C42',
|
||||
itemHoverColor: '#FF8C42',
|
||||
itemSelectedColor: '#FF8C42',
|
||||
},
|
||||
},
|
||||
}}
|
||||
>
|
||||
<Tabs
|
||||
activeKey={props.activeTab}
|
||||
onChange={props.setActiveTab}
|
||||
items={tabItems}
|
||||
style={{ marginBottom: '16px' }}
|
||||
/>
|
||||
</ConfigProvider>
|
||||
{props.activeTab === 'brandDevice' && (
|
||||
<Row>
|
||||
<Col xs={24}>
|
||||
<Row justify="space-between" align="middle" gutter={[8, 8]}>
|
||||
@@ -377,15 +345,6 @@ const ListBrandDevice = memo(function ListBrandDevice(props) {
|
||||
/>
|
||||
</Col>
|
||||
</Row>
|
||||
)}
|
||||
{props.activeTab === 'errorMaster' && (
|
||||
<ListErrorMaster
|
||||
actionMode={props.actionMode}
|
||||
setActionMode={props.setActionMode}
|
||||
selectedData={props.selectedData}
|
||||
setSelectedData={props.setSelectedData}
|
||||
/>
|
||||
)}
|
||||
</Card>
|
||||
</React.Fragment>
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user