"use strict";

exports.__esModule = true;
exports.useEntityPageChild = useEntityPageChild;
var _react = require("react");
var _EntityPageHeader = require("../../components/EntityPageHeader");
var _EntityPageContent = require("../../components/EntityPageContent");
function useEntityPageChild(children, scrollableRef) {
  // Mapping to raw WDS components since original Page filtering none expected components: https://github.com/wix-private/wix-design-systems/blob/master/packages/wix-style-react/src/Page/Page.js#L626
  return _react.Children.toArray(children).map(child => {
    if (/*#__PURE__*/(0, _react.isValidElement)(child)) {
      switch (child.type) {
        case _EntityPageHeader.EntityPageHeader:
          const header = child;
          return header.type.useEntityPageHeader(header);
        case _EntityPageContent.EntityPageContent:
          const content = child;
          return content.type.useEntityPageContent(content, scrollableRef);
        default:
          // TODO: Check whenever we should filter out or not other Page components
          return null;
      }
    }
    return null;
  }).filter(c => c);
}
//# sourceMappingURL=useEntityPageChild.js.map