import React from 'react';
import './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.createElement("div", {
    style: {
      display: 'flex'
    }
  }, /*#__PURE__*/React.createElement("a", {
    href: href
  }, /*#__PURE__*/React.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'
    }]
  }
};
export default logoPaneRegistry;