UNPKG

viam-compliance-deposit-ui

Version:
44 lines (37 loc) 917 B
import React from 'react'; import PropTypes from 'prop-types'; const Table = ({ children, overflowXwith, sectionClass, tableClass, display = 'block', id = null }) => { const section = sectionClass ? `via-container ${sectionClass}` : 'via-container'; const styleRow = {}; if (overflowXwith) { styleRow.width = overflowXwith; } const table = tableClass ? `via-table ${tableClass}` : 'via-table'; return ( <section className={section} style={{ display: `${display}` }}> <table className={table} style={styleRow} role="grid" id={id}> {children} </table> </section> ); }; Table.propTypes = { sectionClass: PropTypes.string, tableClass: PropTypes.string, overflowXwith: PropTypes.string }; Table.defaultProps = { sectionClass: null, tableClass: null, overflowXwith: null }; export default Table;