-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDashboardTabs.tsx
97 lines (91 loc) · 3.14 KB
/
DashboardTabs.tsx
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
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
import * as React from 'react';
import Tabs from '@mui/material/Tabs';
import Tab from '@mui/material/Tab';
import Typography from '@mui/material/Typography';
import Box from '@mui/material/Box';
// import HistoricalDataView from './HistoricalDataView';
import HistoricalDataView from '../tabs/HistoricalDataView/HistoricalDataView';
import LiveDataView from './LiveDataView';
import RecipesView, { Login } from './RecipesView';
import { TEST_PASS, TEST_USER } from '../config';
import WOZView from './WOZView/WOZView';
import DebuggingDataView from './DebuggingDataView';
interface TabPanelProps {
children?: React.ReactNode;
index: number;
value: number;
}
function TabPanel(props: TabPanelProps) {
const { children, value, index, ...other } = props;
return (
<div
role="tabpanel"
hidden={value !== index}
id={`simple-tabpanel-${index}`}
aria-labelledby={`simple-tab-${index}`}
{...other}
>
{value === index && (
<Box sx={{ p: 2 }}>
<Typography component={'div'}>{children}</Typography>
</Box>
)}
</div>
);
}
function a11yProps(index: number) {
return {
id: `simple-tab-${index}`,
'aria-controls': `simple-tabpanel-${index}`,
};
}
export default function DashboardTabs() {
const [value, setValue] = React.useState(0);
const handleChange = (event: React.SyntheticEvent, newValue: number) => {
setValue(newValue);
};
return (
<Box sx={{ pt: 9, pl: 1, width: '100%' }} component="main">
<Box sx={{ borderBottom: 1, borderColor: 'divider' }} >
<Tabs value={value} onChange={handleChange} aria-label="basic tabs example">
<Tab label="Create Data" {...a11yProps(0)} />
<Tab label="Historical Data" {...a11yProps(1)} />
<Tab label="Recipe Collection" {...a11yProps(2)} />
<Tab label="Debuging Models" {...a11yProps(3)} />
<Tab label="Intervenor" {...a11yProps(4)} />
</Tabs>
</Box>
<TabPanel value={value} index={0}>
<LiveDataView />
</TabPanel>
<TabPanel value={value} index={1}>
<HistoricalDataView />
</TabPanel>
<TabPanel value={value} index={2}>
<RecipesView />
</TabPanel>
<TabPanel value={value} index={3}>
<DebuggingDataView />
</TabPanel>
<TabPanel value={value} index={4}>
<WOZView />
</TabPanel>
</Box>
);
}
// <BrowserRouter>
// <Routes>
// <Route exact path = '/' element={<LiveDataView />} />
// <Route path='/recordings'>
// <Route path="" element={<HistoricalDataView />} />
// {/* <Route path=":recordingId" element={<HistoricalDataView />} /> */}
// </Route>
// <Route path='/recipes'>
// <Route path="" element={<RecipesView />} />
// {/* <Route path=":recipeId" element={<RecipesView />} /> */}
// </Route>
// <Route path="/login" element={<Login username={TEST_USER} password={TEST_PASS} />} />
// <Route path="/logout" element={<Logout redirectUri='/' />} />
// <Route path="*" element={<Error404 />} />
// </Routes>
// </BrowserRouter>