'use strict';

var iconsReact = require('@cloudtower/icons-react');
var core = require('@linaria/core');
var index = require('../../core/Icon/index.js');
var index$1 = require('../../core/Typo/index.js');
var React = require('react');

function _interopDefault (e) { return e && e.__esModule ? e : { default: e }; }

var React__default = /*#__PURE__*/_interopDefault(React);

const GobackButtonStyle = "E_gmyahx3";
const GobackButton = props => {
  const {
    onClick,
    path,
    index: index$2,
    title,
    history
  } = props;
  const goto = () => {
    if (path) {
      history.push(path);
      return;
    }
    if (index$2) {
      history.go(index$2);
      return;
    }
    if (onClick) {
      onClick == null ? void 0 : onClick();
      return;
    }
    history.goBack();
  };
  return /* @__PURE__ */React__default.default.createElement("span", {
    className: core.cx(GobackButtonStyle)
  }, /* @__PURE__ */React__default.default.createElement(index, {
    src: iconsReact.ArrowChevronLeft16BoldTertiaryIcon,
    hoverSrc: iconsReact.ArrowChevronLeft16BoldBlueIcon,
    onClick: goto
  }, /* @__PURE__ */React__default.default.createElement("span", {
    className: core.cx(index$1.Typo.Label.l4_bold, "link-text")
  }, title)));
};
var GoBackButton = GobackButton;

module.exports = GoBackButton;
