import { jsx } from 'react/jsx-runtime';
import { addNewRow } from '../Utils/addNewRow.js';
import TableRow from './TableRow.js';

const TableBody = ({
  flattenedTreeData,
  columnsData,
  selected,
  select,
  onRowClick,
  onToggleExpand,
  onCheckBoxChange,
  newNode,
  onAddConfirm,
  onAddCancel,
  handleEditFieldError,
  expanding,
  rootNode,
  selectedNode,
  hideOnDisable,
  scriptLengthTruncate,
  addModuleInputWidth,
  addModuleSelectWidth,
  disableEditLabelConfirmIcon
}) => {
  // commenting this code to add editLabel component to rootnode when data is empty
  // if (checkEmpty(flattenedTreeData)) {
  //   return null;
  // }
  return jsx("tbody", {
    className: "ff-table-tree-body",
    children: addNewRow(flattenedTreeData, newNode ?? {}, rootNode)?.map((node, index) => !node?.hide ? jsx(TableRow, {
      node: node,
      columnsData: columnsData,
      selected: selected,
      select: select,
      onRowClick: onRowClick,
      onToggleExpand: onToggleExpand,
      onCheckBoxChange: onCheckBoxChange,
      onAddConfirm: onAddConfirm,
      onAddCancel: onAddCancel,
      handleEditFieldError: handleEditFieldError,
      isExpanding: node.key === expanding,
      index: index,
      selectedNode: selectedNode,
      hideOnDisable: hideOnDisable,
      scriptLengthTruncate: scriptLengthTruncate,
      addModuleInputWidth: addModuleInputWidth,
      addModuleSelectWidth: addModuleSelectWidth,
      disableEditLabelConfirmIcon: disableEditLabelConfirmIcon
    }, node.key) : null)
  });
};

export { TableBody as default };
//# sourceMappingURL=TableBody.js.map
