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
53 lines (47 loc) · 1.36 KB
/
index.tsx
File metadata and controls
53 lines (47 loc) · 1.36 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
import * as React from 'react'
import { useAppState } 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'
import { FaChrome } from 'react-icons/fa'
const pages: { [key in Tab]: React.FunctionComponent } = {
[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: React.FunctionComponent = () => {
const state = useAppState()
const Page = pages[state.currentTab]
return (
<div className={styles.wrapper}>
<div className={styles.content}>
<Tabs />
<div className={styles.pageContainer}>
{state.isConnecting ? (
<div className={styles.waitWrapper}>
<h1>Application not connected...</h1>
<div>
Click <FaChrome /> to adjust how you want to connect your app
</div>
</div>
) : (
<Page />
)}
</div>
</div>
</div>
)
}
export default Workspace