"use strict";

var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.default = void 0;
var _react = require("react");
var _isBrowser = _interopRequireDefault(require("../../isBrowser"));
function useDocumentTitle(titleInfo, appDefaultTitle) {
  const titleText = typeof titleInfo.pageName === 'string' ? titleInfo.title : appDefaultTitle;
  (0, _react.useEffect)(() => {
    if ((0, _isBrowser.default)() && titleText) {
      document.title = titleText;
    }
  }, [titleInfo.title]);
}
var _default = useDocumentTitle;
exports.default = _default;