import _extends from "@babel/runtime/helpers/esm/extends";
import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
var _excluded = ["type", "href", "className", "alt", "aria-label"];
import * as React from 'react';
import classnames from 'classnames';
import { getLogoUrl } from '../../logo-url';
var LOGO_TYPE = {
  BRAINLY: 'brainly',
  EODEV: 'eodev',
  NOSDEVOIRS: 'nosdevoirs',
  ZNANIJA: 'znanija',
  ZNANIJA_PLUS: 'znanija-plus',
  BRAINLY_PLUS: 'brainly-plus',
  BRAINLY_TUTORING: 'brainly-tutoring'
};
var ICONS = {
  brainly: 'brainly-mobile',
  eodev: 'eodev-mobile',
  nosdevoirs: 'nosdevoirs-mobile',
  znanija: 'znanija-mobile',
  'znanija-plus': 'znanija-plus-small',
  'brainly-plus': 'brainly-plus',
  'brainly-tutoring': 'brainly-tutoring'
};

var HomeButton = function HomeButton(_ref) {
  var _ref$type = _ref.type,
      type = _ref$type === void 0 ? LOGO_TYPE.BRAINLY : _ref$type,
      _ref$href = _ref.href,
      href = _ref$href === void 0 ? '#' : _ref$href,
      className = _ref.className,
      _ref$alt = _ref.alt,
      alt = _ref$alt === void 0 ? '' : _ref$alt,
      ariaLabel = _ref['aria-label'],
      props = _objectWithoutProperties(_ref, _excluded);

  var buttonClass = classnames('sg-home-button', _defineProperty({}, "sg-home-button--".concat(type), type !== LOGO_TYPE.BRAINLY), className);
  var logoPath = "".concat(getLogoUrl(type));
  var mobilePath = "".concat(getLogoUrl(ICONS[type]));
  var defaultAriaLabel = "".concat(type.replace(/-/g, ' '), " home");
  return /*#__PURE__*/React.createElement("a", _extends({}, props, {
    href: href,
    className: buttonClass,
    "aria-label": ariaLabel || defaultAriaLabel
  }), /*#__PURE__*/React.createElement("img", {
    className: "sg-home-button__logo-small",
    src: mobilePath,
    alt: alt
  }), /*#__PURE__*/React.createElement("img", {
    className: "sg-home-button__logo-big",
    src: logoPath,
    alt: alt
  }));
};

export default HomeButton;
export var TYPE = LOGO_TYPE;