viam-compliance-deposit-ui
Version:
A React component for deposit sar alerts.
44 lines (37 loc) • 917 B
JavaScript
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;