forked from cerebral/overmind
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.tsx
More file actions
42 lines (37 loc) · 1 KB
/
index.tsx
File metadata and controls
42 lines (37 loc) · 1 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
import { createElement, SFC } from 'react'
import { useOvermind } from '../../overmind'
import { Tab } from '../../overmind/types'
import * as styles from './styles'
import Tabs from '../Tabs'
import Actions from '../Actions'
import Console from '../Console'
import State from '../State'
import Components from '../Components'
import Flushes from '../Flushes'
import History from '../History'
import Charts from '../Charts'
const pages: { [key in Tab]: SFC } = {
[Tab.Actions]: Actions,
[Tab.Console]: Console,
[Tab.State]: State,
[Tab.Components]: Components,
[Tab.Flushes]: Flushes,
[Tab.Remove]: () => null,
[Tab.History]: History,
[Tab.Charts]: Charts,
}
const Workspace: SFC = () => {
const { state } = useOvermind()
const Page = pages[state.currentTab]
return (
<div className={styles.wrapper}>
<div className={styles.content}>
<Tabs />
<div className={styles.pageContainer}>
<Page />
</div>
</div>
</div>
)
}
export default Workspace