import { Button, Gridicon } from '@automattic/components'; import { Component } from 'react'; import FormInputCheckbox from 'calypso/components/forms/form-checkbox'; import Table from '..'; import TableItem from '../table-item'; import TableRow from '../table-row'; class Example extends Component { state = { hasBorder: false, isCompact: false, }; onToggleCompact = () => { this.setState( { isCompact: ! this.state.isCompact } ); }; render() { const titles = ( { [ 'Title', '', 'Qty', 'Total' ].map( ( item, i ) => ( { item } ) ) } ); // eslint-disable-next-line jsx-a11y/anchor-is-valid const link = An internal Link!; const externalLink = ( // eslint-disable-next-line jsx-a11y/anchor-is-valid ); const placeholder = ''; const values = [ // eslint-disable-next-line jsx-a11y/anchor-is-valid [ 'one', placeholder, 222, 45 ], [ 'really really really really really really long name', placeholder, 55, 777 ], [ 'three', externalLink,
9
, 45 ], [ link, externalLink, , 8 ], ]; const middleColValues = [ [ , 'Thing 1', 65 ], [ , 'Thing 2', 66 ], [ , 'Thing 3', 67 ], [ , 'Thing 4', ], ]; const middleColTitles = ( { [ , 'Description', 'Total' ].map( ( item, i ) => ( { item } ) ) } ); return (
{ values.map( ( row, i ) => ( { row.map( ( item, j ) => ( { item } ) ) } ) ) }
{ middleColValues.map( ( row, i ) => ( { row.map( ( item, j ) => ( { item } ) ) } ) ) }
{ values.map( ( row, i ) => ( { row.map( ( item, j ) => ( { item } ) ) } ) ) }
{ values.map( ( row, i ) => ( { row.map( ( item, j ) => ( { item } ) ) } ) ) }
); } } Example.displayName = 'WooTable'; export default Example;