All files / src/px-table-view index.js

0% Statements 0/3
0% Branches 0/2
0% Functions 0/2
0% Lines 0/3
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                                                                                             
import React from 'react';
import classnames from 'classnames';
 
 
import style from './style.scss';
import TableRow from './px-table-row';
/**
 * px-table-view component
 */
export default({
  items,
  selectedItem,
  selected,
  tappable,
 
  //sizes
  flush,
  tiny,
  small,
  regular,
  large,
  huge,
 
  children}) => {
 
 
  const baseClassnames = classnames(
    'table-view',
    {'table-view--flush': flush},
    {'table-view--tiny': tiny},
    {'table-view--small': small},
    {'table-view--regular': regular},
    {'table-view--large': large},
    {'table-view--huge': huge}
  );
 
	return (
		<div className='px-table-view'>
			<div className={baseClassnames}>
				{items && items.map((item, index) => <TableRow tappable={tappable} key={index} {...item}/>)}
        {children}
			</div>
			<style jsx>{style}</style>
		</div>
	);
}