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
38 lines (34 loc) · 935 Bytes
/
index.tsx
File metadata and controls
38 lines (34 loc) · 935 Bytes
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
import * as React from 'react'
import { connect, Connect } from '../../app'
import AppsBar from '../AppsBar'
import { Tab } from '../../app/types'
import { Wrapper, Content, PageContainer } from './elements'
import Tabs from '../Tabs'
import Actions from '../Actions'
import Console from '../Console'
import State from '../State'
import Components from '../Components'
import Flushes from '../Flushes'
const pages: { [key in Tab]: React.ComponentType } = {
[Tab.Actions]: Actions,
[Tab.Console]: Console,
[Tab.State]: State,
[Tab.Components]: Components,
[Tab.Flushes]: Flushes,
[Tab.Remove]: () => null,
}
const Workspace: React.SFC<Connect> = ({ app }) => {
const Page = pages[app.state.currentTab]
return (
<Wrapper>
<AppsBar />
<Content>
<PageContainer>
<Page />
</PageContainer>
<Tabs />
</Content>
</Wrapper>
)
}
export default connect(Workspace)