"use strict";

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

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

var _caseLibraryCardList = _interopRequireDefault(require("./caseLibrary-cardList"));

var _essayComponent = _interopRequireDefault(require("../../grid-layout/essay-component"));

var _helpers = require("../../../utils/helpers");

var _openData = require("../../../utils/open-data");

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }

var pencil = require("../image/\u7B14.svg");

function CaseLibraryMain(props) {
  var onApplyTpl = props.onApplyTpl,
      cardList = props.cardList,
      isUnlock = props.isUnlock,
      handleShowSubmitOkrWindow = props.handleShowSubmitOkrWindow,
      handleShowPayWindow = props.handleShowPayWindow,
      isfix = props.isfix,
      isLoading = props.isLoading,
      activeNavId = props.activeNavId,
      asideHeightRef = props.asideHeightRef,
      fixAsideTopScroll = props.fixAsideTopScroll; // @ts-ignore

  var DeadLine = window.BSGlobal.tenantAuthentication.DeadLine; // @ts-ignore

  var _window$BSGlobal$logi = window.BSGlobal.loginUserInfo,
      Name = _window$BSGlobal$logi.Name,
      Id = _window$BSGlobal$logi.Id;
  return /*#__PURE__*/_react["default"].createElement("div", {
    className: "okr-cases-library__mainContainer"
  }, /*#__PURE__*/_react["default"].createElement(_caseLibraryCardList["default"], {
    cardList: cardList,
    isUnlock: isUnlock,
    handleShowPayWindow: handleShowPayWindow,
    handleShowSubmitOkrWindow: handleShowSubmitOkrWindow,
    onApplyTpl: onApplyTpl,
    isLoading: isLoading
  }), /*#__PURE__*/_react["default"].createElement("div", {
    className: "okr-cases-library__aside",
    style: {
      right: "0px",
      top: "".concat(fixAsideTopScroll, "px"),
      // @ts-ignore
      position: isfix && cardList.length ? "absolute" : ""
    },
    ref: asideHeightRef
  }, !(0, _helpers.isLocal)() && /*#__PURE__*/_react["default"].createElement("div", {
    className: "okr-cases-library__aside__submitWant"
  }, /*#__PURE__*/_react["default"].createElement("div", {
    className: "okr-cases-library__aside__submitWant__btn",
    onClick: function onClick() {
      return handleShowSubmitOkrWindow(true);
    }
  }, /*#__PURE__*/_react["default"].createElement("img", {
    src: pencil,
    alt: "pencil"
  }), "\u63D0\u4EA4\u6211\u60F3\u8981\u7684OKR\u7C7B\u578B"), /*#__PURE__*/_react["default"].createElement("div", {
    className: "okr-cases-library__aside__submitWant__libraryNum"
  }, "\u5168\u56FD\u6700\u5927 OKR \u6848\u4F8B\u5E93", /*#__PURE__*/_react["default"].createElement("span", {
    style: {
      color: "#F05E5E"
    }
  }, " 1000+"), " ")), isUnlock ? /*#__PURE__*/_react["default"].createElement("div", {
    className: "okr-cases-library__aside__memberInfo"
  }, /*#__PURE__*/_react["default"].createElement("div", {
    className: "okr-cases-library__aside__memberInfo__name"
  }, /*#__PURE__*/_react["default"].createElement(_openData.OpenUserName, {
    name: Name,
    id: Id
  }), "\u7684", /*#__PURE__*/_react["default"].createElement("b", null, " VIP "), "\u4F1A\u5458"), /*#__PURE__*/_react["default"].createElement("p", {
    className: "okr-cases-library__aside__memberInfo__deadLine"
  }, "\u6709\u6548\u65E5\u671F\u81F3\uFF1A", DeadLine)) : /*#__PURE__*/_react["default"].createElement("div", {
    className: "okr-cases-library__aside__advertise",
    onClick: function onClick() {
      return handleShowPayWindow(true);
    }
  }), /*#__PURE__*/_react["default"].createElement(_essayComponent["default"], {
    essayTypeId: activeNavId,
    _className: "okr-cases-library__aside__essay"
  })));
}

var _default = CaseLibraryMain;
exports["default"] = _default;