import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
import "./style.scss";
import { useTable } from "react-table";
const TableShimmer = ({ numberOfRow = 1, columns, }) => {
    numberOfRow;
    const data = [];
    for (let i = 1; i <= numberOfRow; i++) {
        data.push(i);
    }
    const { getTableProps, getTableBodyProps, headerGroups, rows, prepareRow } = useTable({ columns, data });
    return (_jsx("div", { className: "campaignTableShimmer-Generic", children: _jsxs("table", { className: "searchCampaignTable--Generic ", ...getTableProps(), children: [_jsx("thead", { children: headerGroups.map((headerGroup) => (_jsx("tr", { ...headerGroup.getHeaderGroupProps(), children: headerGroup.headers.map((column) => (_jsx("th", { ...column.getHeaderProps(), style: { width: column.width }, children: column.render("Header") }))) }))) }), _jsx("tbody", { ...getTableBodyProps(), children: rows.map((row) => {
                        prepareRow(row);
                        return (_jsx("tr", { ...row.getRowProps(), children: row.cells.map((cell) => {
                                return (_jsx("td", { ...cell.getCellProps(), children: _jsx("div", { className: "campaignTableShimmer-Comment animate" }) }));
                            }) }));
                    }) })] }) }));
};
export default TableShimmer;
