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
67 lines (64 loc) · 2.08 KB
/
index.tsx
File metadata and controls
67 lines (64 loc) · 2.08 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
import * as React from 'react'
import { connect, Connect } from '../../app'
import { Flush as FlushType, FlushReference } from '../../app/types'
import { Pipe } from '../Action/elements'
import { Flush, FlushHeader } from './elements'
import Path from '../ActionPath'
import Text from '../common/Text'
import Icon from '../common/Icon'
type Props = {
flush: FlushType
} & Connect
const ActionFlush: React.SFC<Props> = ({ flush, app }) => {
const isExpanded = app.state.expandAllActionDetails || !flush.isCollapsed
return flush.components.length || flush.derived.length ? (
<Pipe>
<Path />
<Flush>
<FlushHeader
onClick={() => app.actions.toggleCollapsedFlush(flush.flushId)}
>
<Text variant="hint">
<Icon>code</Icon> {flush.components.length}
</Text>
<Text variant="hint">
<Icon>chain</Icon> {flush.derived.length}
</Text>
<Text variant="hint">
<Icon>flask</Icon> {flush.reactions.length}
</Text>
<Text variant="hint">
{isExpanded ? <Icon>chevron-down</Icon> : <Icon>chevron-up</Icon>}
</Text>
</FlushHeader>
{isExpanded ? (
<div>
{flush.components.map((componentId) => (
<div key={componentId}>
<Text variant="hint">
<Icon>code</Icon>{' '}
{app.state.currentApp.components[componentId].name}
</Text>
</div>
))}
{flush.derived.map((derivedPath) => (
<div key={derivedPath}>
<Text variant="hint">
<Icon>chain</Icon> {derivedPath}
</Text>
</div>
))}
{flush.reactions.map((reactionPath) => (
<div key={reactionPath}>
<Text variant="hint">
<Icon>flask</Icon> {reactionPath}
</Text>
</div>
))}
</div>
) : null}
</Flush>
</Pipe>
) : null
}
export default connect(ActionFlush)