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 navigate = useNavigate();
|
||||||
const { setBreadcrumbItems } = useBreadcrumb();
|
const { setBreadcrumbItems } = useBreadcrumb();
|
||||||
|
|
||||||
const [activeTab, setActiveTab] = useState('brandDevice');
|
|
||||||
const [actionMode, setActionMode] = useState('list');
|
const [actionMode, setActionMode] = useState('list');
|
||||||
const [selectedData, setSelectedData] = useState(null);
|
const [selectedData, setSelectedData] = useState(null);
|
||||||
const [readOnly, setReadOnly] = useState(false);
|
const [readOnly, setReadOnly] = useState(false);
|
||||||
@@ -62,8 +61,6 @@ const IndexBrandDevice = memo(function IndexBrandDevice() {
|
|||||||
selectedData={selectedData}
|
selectedData={selectedData}
|
||||||
setSelectedData={setSelectedData}
|
setSelectedData={setSelectedData}
|
||||||
readOnly={readOnly}
|
readOnly={readOnly}
|
||||||
activeTab={activeTab}
|
|
||||||
setActiveTab={setActiveTab}
|
|
||||||
/>
|
/>
|
||||||
<DetailBrandDevice
|
<DetailBrandDevice
|
||||||
setActionMode={setMode}
|
setActionMode={setMode}
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
import React, { memo, useState, useEffect } from 'react';
|
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 {
|
import {
|
||||||
PlusOutlined,
|
PlusOutlined,
|
||||||
EditOutlined,
|
EditOutlined,
|
||||||
@@ -10,7 +10,6 @@ import {
|
|||||||
import { NotifAlert, NotifConfirmDialog } from '../../../../components/Global/ToastNotif';
|
import { NotifAlert, NotifConfirmDialog } from '../../../../components/Global/ToastNotif';
|
||||||
import { useNavigate } from 'react-router-dom';
|
import { useNavigate } from 'react-router-dom';
|
||||||
import TableList from '../../../../components/Global/TableList';
|
import TableList from '../../../../components/Global/TableList';
|
||||||
import ListErrorMaster from './ListErrorMaster';
|
|
||||||
|
|
||||||
// Dummy data
|
// Dummy data
|
||||||
const initialBrandDeviceData = [
|
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 (
|
return (
|
||||||
<React.Fragment>
|
<React.Fragment>
|
||||||
<Card>
|
<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>
|
<Row>
|
||||||
<Col xs={24}>
|
<Col xs={24}>
|
||||||
<Row justify="space-between" align="middle" gutter={[8, 8]}>
|
<Row justify="space-between" align="middle" gutter={[8, 8]}>
|
||||||
@@ -377,15 +345,6 @@ const ListBrandDevice = memo(function ListBrandDevice(props) {
|
|||||||
/>
|
/>
|
||||||
</Col>
|
</Col>
|
||||||
</Row>
|
</Row>
|
||||||
)}
|
|
||||||
{props.activeTab === 'errorMaster' && (
|
|
||||||
<ListErrorMaster
|
|
||||||
actionMode={props.actionMode}
|
|
||||||
setActionMode={props.setActionMode}
|
|
||||||
selectedData={props.selectedData}
|
|
||||||
setSelectedData={props.setSelectedData}
|
|
||||||
/>
|
|
||||||
)}
|
|
||||||
</Card>
|
</Card>
|
||||||
</React.Fragment>
|
</React.Fragment>
|
||||||
);
|
);
|
||||||
|
|||||||
Reference in New Issue
Block a user