"use strict";

exports.__esModule = true;
exports.useSettingsPageChild = useSettingsPageChild;
var _react = require("react");
var _SettingsPageHeader = require("../../components/SettingsPageHeader");
var _SettingsPageContent = require("../../components/SettingsPageContent");
function useSettingsPageChild(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 _SettingsPageHeader.SettingsPageHeader:
          const header = child;
          return header.type.useSettingsPageHeader(header);
        case _SettingsPageContent.SettingsPageContent:
          const content = child;
          return content.type.useSettingsPageContent(content, scrollableRef);
        default:
          // TODO: Check whenever we should filter out or not other Page components
          return null;
      }
    }
    return null;
  }).filter(c => c);
}
//# sourceMappingURL=useSettingsPageChild.js.map