"use strict";

exports.__esModule = true;
exports.usePageHeader = usePageHeader;
var _react = require("react");
var _designSystem = require("@wix/design-system");
function usePageHeader(childrenArr) {
  var _header$props, _header$props2;
  const header = (0, _react.useMemo)(() => childrenArr.find(child => /*#__PURE__*/(0, _react.isValidElement)(child) && child.type === _designSystem.Page.Header), [childrenArr]);
  const title = typeof (header == null || (_header$props = header.props) == null ? void 0 : _header$props.title) === 'string' ? header == null || (_header$props2 = header.props) == null ? void 0 : _header$props2.title : null;
  return {
    header,
    title
  };
}
//# sourceMappingURL=usePageHeader.js.map