'use strict';
import { jsx, Fragment } from 'react/jsx-runtime';
import { memo } from 'react';
import { rowHighlightBehaviors } from '../../../../fd-toolbox/enums/enums.js';
import { getTableBodyRowClasses, getTableBodyRowId } from './TableBody.funcs.js';
import { TableBodyRow } from '../body-row/TableBodyRow.js';

var __defProp = Object.defineProperty;
var __name = (target, value) => __defProp(target, "name", {
  value,
  configurable: true
});
function TableBody({
  tableInstance,
  displayMode,
  onRefreshItems,
  deleteItem,
  onRowClick,
  tableActionType,
  rowHighlightBehavior
}) {
  return tableInstance.tableRows.length > 0 ? /* @__PURE__ */jsx(Fragment, {
    children: tableInstance.tableRows.map((row, index) => /* @__PURE__ */jsx(TableBodyRow, {
      rowContext: {
        row,
        tableInstance,
        internalTableColumns: []
      },
      displayMode,
      onRefreshItems,
      itemDeleted: deleteItem,
      cellClick: onRowClick,
      className: getTableBodyRowClasses(rowHighlightBehavior ?? rowHighlightBehaviors.default),
      tableActionType
    }, getTableBodyRowId(tableInstance, index)))
  }) : /* @__PURE__ */jsx(TableBodyRow, {
    className: "table-cell"
  });
}
__name(TableBody, "TableBody");
const tableBodyMemo = memo(TableBody);
tableBodyMemo.displayName = "TableBody";

export { tableBodyMemo as TableBody };
