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
62 lines (59 loc) · 2.09 KB
/
index.tsx
File metadata and controls
62 lines (59 loc) · 2.09 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
import { createElement, SFC } from 'react'
import { useOvermind } from '../../overmind'
import * as textStyles from '../../styles/text'
import ValueInspector from '../ValueInspector'
import * as styles from './styles'
import { css } from 'emotion'
const Flushes: SFC = () => {
const { state } = useOvermind()
return (
<div className={styles.wrapper}>
<div>
<div className={styles.panels}>
<div className={styles.panel}>
<span className={css(textStyles.label, textStyles.denseLabel)}>
flush count
</span>
<span className={css(textStyles.header, textStyles.denseHeader)}>
{state.flushes.length}
</span>
</div>
<div className={styles.panel}>
<span className={css(textStyles.label, textStyles.denseLabel)}>
mutations count
</span>
<span className={css(textStyles.header, textStyles.denseHeader)}>
{state.flushesMutationsCount}
</span>
</div>
<div className={styles.panel}>
<span className={css(textStyles.label, textStyles.denseLabel)}>
paths updated
</span>
<span className={css(textStyles.header, textStyles.denseHeader)}>
{state.flushesStatePathCount}
</span>
</div>
</div>
</div>
{state.flushes.map((flush, index) => (
<div className={styles.flushWrapper} key={index}>
{flush.mutations.map((mutation, index) => {
return (
<span className={styles.mutation} key={index}>
<span className={textStyles.description}>
<span className={styles.method}>{mutation.method}</span>
</span>
<span className={textStyles.description}>{mutation.path}</span>
{mutation.args.map((arg, index) => (
<ValueInspector key={index} value={arg} small />
))}
</span>
)
})}
</div>
))}
</div>
)
}
export default Flushes