"use strict";

var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.ArchiveSidebarHeader = void 0;
var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
var _possibleConstructorReturn2 = _interopRequireDefault(require("@babel/runtime/helpers/possibleConstructorReturn"));
var _getPrototypeOf2 = _interopRequireDefault(require("@babel/runtime/helpers/getPrototypeOf"));
var _inherits2 = _interopRequireDefault(require("@babel/runtime/helpers/inherits"));
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
var _react = _interopRequireDefault(require("react"));
var _arrowLeft = _interopRequireDefault(require("@atlaskit/icon/core/migration/arrow-left"));
var _home = _interopRequireDefault(require("@atlaskit/icon/core/migration/home"));
var _utils = require("../../utils");
var _styleWrappers = require("./styleWrappers");
var _customButtonItem = require("./custom-button-item");
function _callSuper(t, o, e) { return o = (0, _getPrototypeOf2.default)(o), (0, _possibleConstructorReturn2.default)(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], (0, _getPrototypeOf2.default)(t).constructor) : o.apply(t, e)); }
function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
var ArchiveSidebarHeader = exports.ArchiveSidebarHeader = /*#__PURE__*/function (_React$Component) {
  function ArchiveSidebarHeader() {
    var _this;
    (0, _classCallCheck2.default)(this, ArchiveSidebarHeader);
    for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
      args[_key] = arguments[_key];
    }
    _this = _callSuper(this, ArchiveSidebarHeader, [].concat(args));
    (0, _defineProperty2.default)(_this, "getHeaderIcon", function () {
      return !!_this.props.folderName ? /*#__PURE__*/_react.default.createElement(_arrowLeft.default, {
        color: "currentColor",
        spacing: "spacious",
        label: "Back"
      }) : /*#__PURE__*/_react.default.createElement(_home.default, {
        color: "currentColor",
        spacing: "spacious",
        label: "Home"
      });
    });
    return _this;
  }
  (0, _inherits2.default)(ArchiveSidebarHeader, _React$Component);
  return (0, _createClass2.default)(ArchiveSidebarHeader, [{
    key: "render",
    value: function render() {
      var _this$props = this.props,
        folderName = _this$props.folderName,
        onHeaderClick = _this$props.onHeaderClick;
      return /*#__PURE__*/_react.default.createElement(_customButtonItem.CustomButtonItem, {
        onClick: onHeaderClick
      }, /*#__PURE__*/_react.default.createElement(_styleWrappers.SidebarHeaderWrapper, null, /*#__PURE__*/_react.default.createElement(_styleWrappers.SidebarHeaderIcon, null, this.getHeaderIcon()), /*#__PURE__*/_react.default.createElement(_styleWrappers.SidebarHeaderEntry, null, (0, _utils.getFormattedFolderName)(folderName))));
    }
  }]);
}(_react.default.Component);