"use strict";

Object.defineProperty(exports, "__esModule", {
  value: true
});
exports["default"] = PropertyPanelContainer;

var _ecommerce = require("@whalecloud/ecommerce");

var _fdx = require("@whalecloud/fdx");

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

require("./index.less");

function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }

function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { "default": obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj["default"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; }

function PropertyPanelContainer(props) {
  var typeToTitle = {
    MBanner: 'Banner',
    MSearchBar: 'Search Bar',
    MCarouselSearchBar: 'Search Bar',
    MProductAdvertise: 'Image',
    MGroup: 'Group',
    MCarousel: 'Carousel Banner',
    GalaryTemplate4: '4 Images Banner',
    MCatalogMenu: 'Pages Navigation',
    MScroll: 'Slider Product Recommendation',
    MMultipleBanners: 'Multiple Banners',
    MFlashSales: 'Flash Sales',
    MText: 'Floor Title',
    MProductList: 'Product List',
    MFlashSale: 'Flash Sales',
    MIconGrid: 'Icon Grid',
    MFlashService: 'Flash Service',
    MRecommend: 'Recommendation',
    MMProductList: 'Product List',
    MCouponList: 'Coupon List',
    MImgArea: 'Clickable Area',
    MPageTitle: 'Page Title',
    MGroupParticipants: 'Group Participants',
    MGroupGoods: 'Group Goods',
    MImg: 'Image'
  };
  var changeProperty = props.changeProperty;
  (0, _react.useEffect)(function () {
    changeProperty(props);
  }, [props]);
  return /*#__PURE__*/_react["default"].createElement("div", {
    className: "propertyPanelContainer"
  }, /*#__PURE__*/_react["default"].createElement(_ecommerce.Scrollbars, {
    autoHide: true,
    thumbSize: 200
  }, /*#__PURE__*/_react["default"].createElement(_fdx.Card, {
    bordered: false,
    title: typeToTitle[props.type]
  }, props.children)));
}