"use strict";
const React = require("react");
const merge = require("../../../../../../../lodash@4.17.21/node_modules/lodash/merge.js");
const is = require("../../_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 = React.useMemo(function() {
    return is.isObject(components) ? merge({}, 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
  };
}
module.exports = useComponent;
//# sourceMappingURL=useComponent.js.map
