import _classCallCheck from "@babel/runtime/helpers/classCallCheck";
import _createClass from "@babel/runtime/helpers/createClass";
import _possibleConstructorReturn from "@babel/runtime/helpers/possibleConstructorReturn";
import _getPrototypeOf from "@babel/runtime/helpers/getPrototypeOf";
import _inherits from "@babel/runtime/helpers/inherits";
import _defineProperty from "@babel/runtime/helpers/defineProperty";
function _callSuper(t, o, e) { return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], _getPrototypeOf(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; })(); }
import React from 'react';
import ArrowLeftIcon from '@atlaskit/icon/core/migration/arrow-left';
import HomeIcon from '@atlaskit/icon/core/migration/home';
import { getFormattedFolderName } from '../../utils';
import { SidebarHeaderEntry, SidebarHeaderIcon, SidebarHeaderWrapper } from './styleWrappers';
import { CustomButtonItem } from './custom-button-item';
export var ArchiveSidebarHeader = /*#__PURE__*/function (_React$Component) {
  function ArchiveSidebarHeader() {
    var _this;
    _classCallCheck(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));
    _defineProperty(_this, "getHeaderIcon", function () {
      return !!_this.props.folderName ? /*#__PURE__*/React.createElement(ArrowLeftIcon, {
        color: "currentColor",
        spacing: "spacious",
        label: "Back"
      }) : /*#__PURE__*/React.createElement(HomeIcon, {
        color: "currentColor",
        spacing: "spacious",
        label: "Home"
      });
    });
    return _this;
  }
  _inherits(ArchiveSidebarHeader, _React$Component);
  return _createClass(ArchiveSidebarHeader, [{
    key: "render",
    value: function render() {
      var _this$props = this.props,
        folderName = _this$props.folderName,
        onHeaderClick = _this$props.onHeaderClick;
      return /*#__PURE__*/React.createElement(CustomButtonItem, {
        onClick: onHeaderClick
      }, /*#__PURE__*/React.createElement(SidebarHeaderWrapper, null, /*#__PURE__*/React.createElement(SidebarHeaderIcon, null, this.getHeaderIcon()), /*#__PURE__*/React.createElement(SidebarHeaderEntry, null, getFormattedFolderName(folderName))));
    }
  }]);
}(React.Component);