/
ChartBox.stories.js
51 lines (50 loc) · 1.19 KB
/
ChartBox.stories.js
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
import React from 'react';
import { storiesOf } from '@storybook/react';
import ChartBox from './ChartBox';
import mockStoryData from './ChartBox.fixtures';
import Story from '../../../../../stories/components/Story';
storiesOf('Components/Charts', module)
.add('Loading', () => (
<Story narrow>
<ChartBox
chart={{ data: [] }}
noDataMsg="No data here"
title="Title"
status="PENDING"
/>
</Story>
))
.add('Without Data', () => (
<Story narrow>
<ChartBox
type="donut"
chart={{ data: [] }}
noDataMsg="No data here"
title="Title"
status="RESOLVED"
/>
</Story>
))
.add('With Error', () => (
<Story narrow>
<ChartBox
chart={{ data: [] }}
title="Title"
noDataMsg="No data here"
errorText="Ooops"
status="ERROR"
/>
</Story>
))
.add('With Data + Modal', () => (
<Story narrow>
<ChartBox
type="donut"
chart={{ data: mockStoryData.config.data.columns }}
noDataMsg={mockStoryData.noDataMsg}
tip={mockStoryData.tip}
title={mockStoryData.title}
status="RESOLVED"
/>
</Story>
));