import { createElement as _createElement } from "react";
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
import React from "react";
import { useTable } from "react-table";
import "../style.scss";
const RevenueTable = ({ revenueHeader, revenueData }) => {
    const data = revenueData;
    const head = revenueHeader;
    const columns = React.useMemo(() => [{ Header: "Revenue", accessor: "revenue" }, ...head], []);
    const { getTableProps, getTableBodyProps, headerGroups, rows, prepareRow } = useTable({ columns, data });
    return (_jsx(_Fragment, { children: _jsxs("table", { className: "companyViewFinancial-RevenueTable", ...getTableProps(), children: [_jsx("thead", { children: headerGroups.map((headerGroup) => (_jsx("tr", { ...headerGroup.getHeaderGroupProps(), children: headerGroup.headers.map((column) => (_jsx("th", { ...column.getHeaderProps(), children: column.render("Header") }))) }))) }), _jsx("tbody", { ...getTableBodyProps(), children: rows.map((row) => {
                        prepareRow(row);
                        return (_createElement("tr", { ...row.getRowProps(), key: `${row.original.publicIdentifier}${row.original.isSelected}` }, row.cells.map((cell) => {
                            return (_jsx("td", { ...cell.getCellProps(), children: cell.render("Cell") }));
                            //   }
                        })));
                    }) })] }) }));
};
export default RevenueTable;
