UNPKG

947 BJavaScriptView Raw
1import React from 'react'
2import { ExportButton } from '../../src'
3
4const headers = [
5 {
6 ident: 'unitId',
7 display: 'Unit',
8 type: 'str',
9 editable: true,
10 isKey: false,
11 alignment: 'center',
12 width: 80,
13 },
14 {
15 ident: 'emerMaxOvr',
16 display: 'Emer. Max. Ovr',
17 type: 'num',
18 numFormat: '0.00',
19 editable: true,
20 isKey: false,
21 alignment: 'center',
22 width: 80,
23 },
24 {
25 ident: 'commitStatusOvr',
26 display: 'Commit. Status Ovr',
27 type: 'str',
28 editable: true,
29 isKey: false,
30 alignment: 'center',
31 width: 80,
32 },
33]
34
35const data = [
36 {
37 unitId: 'ABC',
38 emerMaxOvr: '34.2',
39 commitStatusOvr: 'PENDING',
40 },
41 {
42 unitId: 'PQR',
43 emerMaxOvr: '45.6',
44 commitStatusOvr: 'COMMITTED',
45 },
46 {
47 unitId: 'XYZ',
48 emerMaxOvr: '87.3',
49 commitStatusOvr: 'REJECTED',
50 },
51]
52
53export default () => <ExportButton headers={headers} data={data} fileName={'test'} />
54
\No newline at end of file