mirror of
https://github.com/bluewave-labs/Checkmate.git
synced 2026-04-30 13:45:12 -05:00
make config optional, safe SX access
This commit is contained in:
@@ -62,8 +62,8 @@ const DataTable = ({ headers, data, config }) => {
|
||||
return (
|
||||
<TableRow
|
||||
key={row.id}
|
||||
sx={config.rowSX}
|
||||
onClick={() => config.onRowClick(row)}
|
||||
sx={config?.rowSX ?? {}}
|
||||
onClick={() => config?.onRowClick(row)}
|
||||
>
|
||||
{headers.map((header, index) => {
|
||||
return (
|
||||
@@ -96,7 +96,7 @@ DataTable.propTypes = {
|
||||
config: PropTypes.shape({
|
||||
onRowClick: PropTypes.func.isRequired,
|
||||
rowSX: PropTypes.object,
|
||||
}).isRequired,
|
||||
}),
|
||||
};
|
||||
|
||||
export default DataTable;
|
||||
|
||||
Reference in New Issue
Block a user