()
| 26 | } |
| 27 | |
| 28 | renderContent() { |
| 29 | const toolbar = this.renderToolbar(); |
| 30 | const data = this.tableData(); |
| 31 | const footer = this.renderFooter(); |
| 32 | let content = null; |
| 33 | let headers = null; |
| 34 | if (data !== undefined) { |
| 35 | if (!Array.isArray(data)) { |
| 36 | console.warn('tableData() needs to return an array of objects'); |
| 37 | } else { |
| 38 | if (data.length === 0) { |
| 39 | content = <div className={styles.empty}>{this.renderEmpty()}</div>; |
| 40 | } else { |
| 41 | headers = this.renderHeaders(); |
| 42 | content = ( |
| 43 | <div className={styles.rows}> |
| 44 | <table> |
| 45 | <tbody>{data.map(row => this.renderRow(row))}</tbody> |
| 46 | </table> |
| 47 | {footer} |
| 48 | </div> |
| 49 | ); |
| 50 | } |
| 51 | } |
| 52 | } |
| 53 | const extras = this.renderExtras ? this.renderExtras() : null; |
| 54 | const loading = this.state ? this.state.loading : false; |
| 55 | return ( |
no test coverage detected