import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
import { useEffect, useRef } from 'react';
import { range } from './util';
const Table = ({ children, columns, hideColumnIndicators, useTableRef, }) => {
    const tableRef = useRef(null);
    const columnCount = columns + (hideColumnIndicators ? 0 : 1);
    const columnNodes = range(columnCount).map((i) => _jsx("col", {}, i));
    useEffect(() => {
        if (useTableRef && tableRef.current) {
            useTableRef(tableRef);
        }
    }, [useTableRef]);
    return (_jsxs("table", { className: "ff-spreadsheet-table", ref: tableRef, children: [_jsx("colgroup", { children: columnNodes }), _jsx("tbody", { children: children })] }));
};
export default Table;
//# sourceMappingURL=Table.js.map