Path: blob/main/web/ui/src/features/component/Table.tsx
5304 views
import React from 'react';12import styles from './Table.module.css';34interface Props {5tableHeaders: string[];6style?: React.CSSProperties;7renderTableData: () => JSX.Element[];8}910/**11* Simple table component that accept a custom header, and custom render12* function for the table data13*/14const Table = ({ tableHeaders, style = {}, renderTableData }: Props) => {15return (16<table className={styles.table}>17<colgroup span={1} style={style} />18<tbody>19<tr>20{tableHeaders.map((header) => (21<th key={header}>{header}</th>22))}23</tr>24{renderTableData()}25</tbody>26</table>27);28};2930export default Table;313233