import { useMemo } from "react";
import merge_1 from "../../../../../../../lodash@4.17.21/node_modules/lodash/merge.js";
import { isObject } from "../../_util/is.js";
var defaultComponents = {
  table: "table",
  header: {
    operations: function(_a) {
      var selectionNode = _a.selectionNode, expandNode = _a.expandNode;
      return [
        {
          name: "expandNode",
          node: expandNode
        },
        {
          name: "selectionNode",
          node: selectionNode
        }
      ];
    },
    wrapper: "div",
    thead: "thead",
    row: "tr",
    th: "th",
    cell: "div"
  },
  body: {
    operations: function(_a) {
      var selectionNode = _a.selectionNode, expandNode = _a.expandNode;
      return [
        {
          name: "expandNode",
          node: expandNode
        },
        {
          name: "selectionNode",
          node: selectionNode
        }
      ];
    },
    wrapper: "div",
    tbody: "tbody",
    row: "tr",
    td: "td",
    cell: "span"
  }
};
function useComponent(components) {
  var _components = useMemo(function() {
    return isObject(components) ? merge_1({}, defaultComponents, components) : defaultComponents;
  }, [components]);
  return {
    getHeaderComponentOperations: _components.header.operations,
    getBodyComponentOperations: _components.body.operations,
    ComponentTable: _components.table,
    ComponentHeaderWrapper: _components.header.wrapper,
    ComponentThead: _components.header.thead,
    ComponentHeaderRow: _components.header.row,
    ComponentTh: _components.header.th,
    ComponentHeaderCell: _components.header.cell,
    ComponentBodyWrapper: _components.body.wrapper,
    ComponentTbody: _components.body.tbody,
    ComponentBodyRow: _components.body.row,
    ComponentTd: _components.body.td,
    ComponentBodyCell: _components.body.cell
  };
}
export {
  useComponent as default
};
//# sourceMappingURL=useComponent.js.map
