Table now renders an arbitrary number of columns.

This commit is contained in:
M M committed 2024-07-11 13:20:15 -07:00
1 parent 14bd0da891
commit c9a3f54a65
2 files changed
+36 -18

No files matched your search

+7 -1
View File
@@ -65,6 +65,12 @@ const sampleData = [
{ name: <StatusLabel status="Down" customStyles={{ backgroundColor: '#fff9f9', borderColor: '#ffcac6', color: '#344054' }} />, date: '2024-03-14 21:41:09', message: 'HTTP 350 - NOK' },
];
const columns = [
{ id: 'name', header: 'Status' },
{ id: 'date', header: 'Date & Time' },
{ id: 'message', header: 'Message' },
];
/**
* Customized table component displaying incident history with a filter.
* @returns {JSX.Element} The JSX element representing the customized table with a filter.
@@ -90,7 +96,7 @@ export default function CustomizedTables() {
</Typography>
<Filter />
</Box>
<StatusTable data={sampleData} />
<StatusTable data={sampleData} columns={columns} />
</Box>
);
}