-
Notifications
You must be signed in to change notification settings - Fork 16
Expand file tree
/
Copy pathEditControls.js
More file actions
75 lines (70 loc) · 1.83 KB
/
EditControls.js
File metadata and controls
75 lines (70 loc) · 1.83 KB
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
import Box from '@mui/material/Box';
import { useSelector } from '@xstate/react';
import SpotsControls from '../DisplayControls/SpotsControls';
import { useLabelMode } from '../ProjectContext';
import CellControls from './CellControls';
import CellTypeControls from './CellTypeControls';
import TrackingControls from './DivisionsControls';
import SegmentControls from './SegmentControls';
import SegmentSamControls from './SegmentSamControls';
function TabPanel(props) {
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 && children}
</div>
);
}
function EditControls() {
const labelMode = useLabelMode();
const value = useSelector(labelMode, (state) => {
return state.matches('editSegment')
? 0
: state.matches('editSegmentSam')
? 1
: state.matches('editCells')
? 2
: state.matches('editDivisions')
? 3
: state.matches('editCellTypes')
? 4
: state.matches('editSpots')
? 5
: false;
});
return (
<Box
sx={{
flex: '0 0 auto',
px: 1,
minWidth: '150px',
}}
>
<TabPanel value={value} index={0}>
<SegmentControls />
</TabPanel>
<TabPanel value={value} index={1}>
<SegmentSamControls />
</TabPanel>
<TabPanel value={value} index={2}>
<CellControls />
</TabPanel>
<TabPanel value={value} index={3}>
<TrackingControls />
</TabPanel>
<TabPanel value={value} index={4}>
<CellTypeControls />
</TabPanel>
<TabPanel value={value} index={5}>
<SpotsControls />
</TabPanel>
</Box>
);
}
export default EditControls;