import React from 'react';
import classNames from 'classnames';
/**
 * 共享的头部组件
 * 包含 Logo、标题、副标题、描述
 */
var Header = function Header(_ref) {
  var _ui$logo, _ui$logo2, _ui$title, _ui$logo3, _ui$logo4, _ui$logo$size, _ui$logo$size2, _ui$title2, _ui$subtitle, _ui$desc, _ui$subtitle2, _ui$desc2;
  var ui = _ref.ui;
  return /*#__PURE__*/React.createElement("div", {
    className: "login2-header"
  }, ui !== null && ui !== void 0 && (_ui$logo = ui.logo) !== null && _ui$logo !== void 0 && _ui$logo.show && ui !== null && ui !== void 0 && (_ui$logo2 = ui.logo) !== null && _ui$logo2 !== void 0 && _ui$logo2.url || ui !== null && ui !== void 0 && (_ui$title = ui.title) !== null && _ui$title !== void 0 && _ui$title.show ? /*#__PURE__*/React.createElement("div", {
    className: "login2-header-top"
  }, (ui === null || ui === void 0 || (_ui$logo3 = ui.logo) === null || _ui$logo3 === void 0 ? void 0 : _ui$logo3.show) && (ui === null || ui === void 0 || (_ui$logo4 = ui.logo) === null || _ui$logo4 === void 0 ? void 0 : _ui$logo4.url) && /*#__PURE__*/React.createElement("div", {
    className: classNames('login2-logo', ui.logo.position || 'center')
  }, /*#__PURE__*/React.createElement("img", {
    src: ui.logo.url,
    alt: "logo",
    style: {
      width: ((_ui$logo$size = ui.logo.size) === null || _ui$logo$size === void 0 ? void 0 : _ui$logo$size.width) || 48,
      height: ((_ui$logo$size2 = ui.logo.size) === null || _ui$logo$size2 === void 0 ? void 0 : _ui$logo$size2.height) || 48
    }
  })), (ui === null || ui === void 0 || (_ui$title2 = ui.title) === null || _ui$title2 === void 0 ? void 0 : _ui$title2.show) && /*#__PURE__*/React.createElement("div", {
    className: "login2-title",
    style: {
      textAlign: ui.title.align || 'center'
    }
  }, ui.title.text || 'Welcome')) : null, ui !== null && ui !== void 0 && (_ui$subtitle = ui.subtitle) !== null && _ui$subtitle !== void 0 && _ui$subtitle.show || ui !== null && ui !== void 0 && (_ui$desc = ui.desc) !== null && _ui$desc !== void 0 && _ui$desc.show ? /*#__PURE__*/React.createElement("div", {
    className: "login2-header-bottom"
  }, (ui === null || ui === void 0 || (_ui$subtitle2 = ui.subtitle) === null || _ui$subtitle2 === void 0 ? void 0 : _ui$subtitle2.show) && /*#__PURE__*/React.createElement("p", {
    className: "login2-subtitle",
    style: {
      textAlign: ui.subtitle.align || 'center'
    }
  }, ui.subtitle.text || 'Please login to continue'), (ui === null || ui === void 0 || (_ui$desc2 = ui.desc) === null || _ui$desc2 === void 0 ? void 0 : _ui$desc2.show) && /*#__PURE__*/React.createElement("p", {
    className: "login2-desc",
    style: {
      textAlign: ui.desc.align || 'center'
    }
  }, ui.desc.text || 'Welcome back! Please enter your details.')) : null);
};
export default Header;