Rev 725 | AutorÃa | Comparar con el anterior | Ultima modificación | Ver Log |
import React from 'react';
import {
Paper,
Table as MaterialTable,
TableBody,
TableCell,
TableContainer,
TableHead,
TableRow
} from '@mui/material';
const Table = ({ columns = [], rows = [] }) => {
return (
<TableContainer component={Paper}>
<MaterialTable sx={{ minWidth: 700 }} aria-label='customized table'>
<TableHead>
<TableRow>
{columns.map(({ field, headerName }) => (
<TableCell key={field} align='right'>
{headerName}
</TableCell>
))}
</TableRow>
</TableHead>
<TableBody>
{rows.map((row, id) => (
<TableRow key={id}>
<TableCell component='th' scope='row'>
{JSON.stringify(row)}
</TableCell>
</TableRow>
))}
</TableBody>
</MaterialTable>
</TableContainer>
);
};
export default Table;