import React, { forwardRef } from 'react';
import { observer } from 'mobx-react-lite';
import { LoadingRowTD } from '../LoadingRow/LoadingRowTD';
export const TableBaseRow = observer(forwardRef((props, ref) => {
    const { state, rowData, children, ...rest } = props;
    const isLoadingRow = state.isLoading(rowData.id);
    return (React.createElement("tr", { ref: ref, ...rest, style: {
            ...rest.style,
            position: isLoadingRow ? 'relative' : rest.style?.position,
        } }, isLoadingRow && Array.isArray(children)
        ? children.map((child, index) => {
            return index === children.length - 1 ? (React.createElement(LoadingRowTD, { key: index, state: state, replacedCell: child })) : (React.cloneElement(child, {
                key: index,
                style: { visibility: 'hidden' },
            }));
        })
        : children));
}));
//# sourceMappingURL=TableBaseRow.js.map