import _defineProperty from "@babel/runtime/helpers/defineProperty";
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 class ArchiveSidebarHeader extends React.Component {
  constructor(...args) {
    super(...args);
    _defineProperty(this, "getHeaderIcon", () => !!this.props.folderName ? /*#__PURE__*/React.createElement(ArrowLeftIcon, {
      color: "currentColor",
      spacing: "spacious",
      label: "Back"
    }) : /*#__PURE__*/React.createElement(HomeIcon, {
      color: "currentColor",
      spacing: "spacious",
      label: "Home"
    }));
  }
  render() {
    const {
      folderName,
      onHeaderClick
    } = this.props;
    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))));
  }
}