"use strict";

Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.default = withTableRowSelection;
var _react = _interopRequireDefault(require("react"));
var _selectableTableRow = _interopRequireDefault(require("./selectable-table-row"));
var _jsxRuntime = require("react/jsx-runtime");
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
function withTableRowSelection(BaseTable) {
  function WithTableRowSelection({
    onRowClick,
    onRowDblClick,
    isRowEnabled,
    selectedItemId,
    trProps,
    TrComponent,
    rowIdAccessor,
    ...props
  }) {
    return /*#__PURE__*/(0, _jsxRuntime.jsx)(BaseTable, {
      ...props,
      TrComponent: _selectableTableRow.default,
      trProps: {
        ...trProps,
        onRowClick,
        onRowDblClick,
        isRowEnabled,
        selectedItemId,
        rowIdAccessor,
        TrComponent
      }
    });
  }
  return WithTableRowSelection;
}