#
luxiaotao1123
2024-10-16 dc31d8c4e1e45d6f932050a0da4e18a09d8dfd07
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
import React, { useState, useRef, useEffect } from 'react';
import { useTranslate } from "react-admin";
import { Box, Typography, Tabs, Tab, Stack, useTheme, Divider } from '@mui/material';
import ShelfMain from './ShelfMain';
import JsonShow from '../../JsonShow';
 
const ShelfInsight = (props) => {
    const { sprite } = props;
    const theme = useTheme();
    const themeMode = theme.palette.mode;
    const translate = useTranslate();
 
    const [activeTab, setActiveTab] = useState(0);
    const [curLocNo, setCurLocNo] = useState(null);
 
    const handleTabChange = (event, newValue) => {
        setActiveTab(newValue);
    };
 
    return (
        <Box sx={{ height: '100%', display: 'flex', flexDirection: 'column' }}>
            <Tabs
                value={activeTab}
                onChange={handleTabChange}
                indicatorColor="primary"
                textColor="primary"
                centered
                sx={{ mb: 0 }}
            >
                <Tab label={translate('page.map.settings.map.title')} />
                <Tab label={translate('page.map.settings.config.title')} />
            </Tabs>
 
            <Divider />
 
            <Box flex={1} pt={2}>
                {activeTab === 0 && (
                    <ShelfMain
                        data={sprite?.data}
                        curLocNo={curLocNo}
                        setCurLocNo={setCurLocNo}
                    />
                )}
                {activeTab === 1 && (
                    <JsonShow
                        data={sprite?.data}
                        height={550}
                    />
                )}
            </Box>
        </Box>
    )
}
 
export default ShelfInsight;