|
| 1 | +import 'trendmicro-ui/dist/css/trendmicro-ui.css'; |
| 2 | +import React, { Component } from 'react'; |
| 3 | +import Table from '../../src'; |
| 4 | +import Section from '../Section'; |
| 5 | +import styles from '../index.styl'; |
| 6 | + |
| 7 | +const ipsum = 'Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur.'; |
| 8 | +//Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.'; |
| 9 | + |
| 10 | +export default class extends Component { |
| 11 | + columns = [ |
| 12 | + { |
| 13 | + title: 'Event Type', |
| 14 | + render: (value, row, index) => { |
| 15 | + return row.eventType; |
| 16 | + } |
| 17 | + }, |
| 18 | + { |
| 19 | + title: 'Affected Devices', |
| 20 | + render: (value, row, index) => { |
| 21 | + return row.affectedDevices; |
| 22 | + } |
| 23 | + }, |
| 24 | + { |
| 25 | + title: 'Detections', |
| 26 | + render: (value, row, index) => { |
| 27 | + return row.detections; |
| 28 | + } |
| 29 | + }, |
| 30 | + { |
| 31 | + title: 'Description', |
| 32 | + dataKey: 'description' |
| 33 | + } |
| 34 | + ]; |
| 35 | + |
| 36 | + data = [ |
| 37 | + { id: 1, eventType: 'Virus/Malware', affectedDevices: 20, detections: 634, description: ipsum }, |
| 38 | + { id: 2, eventType: 'Spyware/Grayware', affectedDevices: 20, detections: 634, description: ipsum }, |
| 39 | + { id: 3, eventType: 'URL Filtering', affectedDevices: 15, detections: 598, description: ipsum }, |
| 40 | + { id: 4, eventType: 'Web Reputation', affectedDevices: 15, detections: 598, description: ipsum }, |
| 41 | + { id: 5, eventType: 'Network Virus', affectedDevices: 15, detections: 497, description: ipsum }, |
| 42 | + { id: 6, eventType: 'Application Control', affectedDevices: 0, detections: 0, description: ipsum, width: '40%' } |
| 43 | + ]; |
| 44 | + |
| 45 | + render() { |
| 46 | + const columns = this.columns; |
| 47 | + const data = this.data; |
| 48 | + |
| 49 | + return ( |
| 50 | + <div className="col-md-12"> |
| 51 | + <Section className="row-sm-10"> |
| 52 | + <h3>Justified</h3> |
| 53 | + <div className={styles.sectionGroup}> |
| 54 | + <Table |
| 55 | + bordered={false} |
| 56 | + hoverable={false} |
| 57 | + justified={true} |
| 58 | + rowKey={record => record.id} |
| 59 | + columns={columns} |
| 60 | + data={data} |
| 61 | + /> |
| 62 | + </div> |
| 63 | + </Section> |
| 64 | + </div> |
| 65 | + ); |
| 66 | + } |
| 67 | +} |
0 commit comments