import { _ as __assign } from '../tslib.es6-faad35dc.js';
import { jsx, jsxs } from 'react/jsx-runtime';
import MuiTable from '@mui/material/Table';
import MuiTableRow from '@mui/material/TableRow';
import MuiTableBody from '@mui/material/TableBody';
import MuiTableHead from '@mui/material/TableHead';
import MuiTableContainer from '@mui/material/TableContainer';
import MuiTableCell from '@mui/material/TableCell';

/**
 * Utilities
 */
function createCellData(dataSets, cellDataKeys) {
    var cellData = {};
    cellDataKeys.forEach(function (key, index) { return (cellData[key] = dataSets[index]); });
    return cellData;
}
function formatCellDataRowsIntoArray(data) {
    var array = [];
    for (var property in data) {
        array.push(data[property]);
    }
    return array;
}
var TableContainer = function (_a) {
    var headCells = _a.headCells, bodyCellsRows = _a.bodyCellsRows;
    return (jsx(MuiTableContainer, { children: jsxs(MuiTable, __assign({ "aria-labelledby": "tableTitle", "aria-label": "enhanced table" }, { children: [jsx(MuiTableHead, { children: jsx(MuiTableRow, { children: headCells.map(function (cell, cellIndex) { return (jsx(MuiTableCell, __assign({}, cell.props, { children: cell.label }), cellIndex)); }) }, void 0) }, void 0), jsx(MuiTableBody, { children: bodyCellsRows.map(function (rowCells, index) { return (jsx(MuiTableRow, { children: formatCellDataRowsIntoArray(rowCells).map(function (cell, cellIndex) { return (jsx(MuiTableCell, __assign({}, cell.props, { children: cell.content }), cellIndex)); }) }, index)); }) }, void 0)] }), void 0) }, void 0));
};

export { createCellData, TableContainer as default, formatCellDataRowsIntoArray };
