"use strict";

var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");

exports.__esModule = true;
exports["default"] = void 0;

var _react = _interopRequireDefault(require("react"));

require("./index.scss");

var DefaultLogo = {
  logo: "https://img.alicdn.com/tfs/TB1TpTiBhv1gK0jSZFFXXb0sXXa-104-36.svg",
  href: "/"
};

function LogoPane(props) {
  var logo = props.logo,
      href = props.href;
  return /*#__PURE__*/_react["default"].createElement("div", {
    style: {
      display: 'flex'
    }
  }, /*#__PURE__*/_react["default"].createElement("a", {
    href: href
  }, /*#__PURE__*/_react["default"].createElement("img", {
    src: logo,
    height: "35",
    alt: "logo"
  })));
}

var logoPaneRegistry = function logoPaneRegistry(ctx, options) {
  var logo = options !== null && options !== void 0 && options.logo ? options : DefaultLogo;
  return {
    name: 'logoPlugin',
    init: function init() {
      // 注册 logo 面板
      ctx.skeleton.add({
        area: "topArea",
        type: "Widget",
        name: "logo",
        content: LogoPane,
        contentProps: logo,
        props: {
          align: "left",
          width: 100
        }
      });
    }
  };
};

logoPaneRegistry.pluginName = 'logoPaneRegistry';
logoPaneRegistry.meta = {
  preferenceDeclaration: {
    properties: [{
      key: 'logo'
    }, {
      key: 'href'
    }]
  }
};
var _default = logoPaneRegistry;
exports["default"] = _default;