"use strict";

var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");

Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.default = void 0;

var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));

var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));

var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));

var _react = _interopRequireDefault(require("react"));

var _box = _interopRequireDefault(require("../box"));

var _classnames = _interopRequireDefault(require("classnames"));

var _uiIllustrations = require("@teamleader/ui-illustrations");

var _typography = require("../typography");

var _theme = _interopRequireDefault(require("./theme.css"));

var _excluded = ["className", "metaText", "hidePointer", "size", "title"];
var illustrationMap = {
  small: /*#__PURE__*/_react.default.createElement(_uiIllustrations.IllustrationEmptyState36X36Pointer, null),
  medium: /*#__PURE__*/_react.default.createElement(_uiIllustrations.IllustrationEmptyState48X48Pointer, null),
  large: /*#__PURE__*/_react.default.createElement(_uiIllustrations.IllustrationEmptyState130X130Pointer, null)
};

var EmptyState = function EmptyState(_ref) {
  var className = _ref.className,
      metaText = _ref.metaText,
      _ref$hidePointer = _ref.hidePointer,
      hidePointer = _ref$hidePointer === void 0 ? false : _ref$hidePointer,
      _ref$size = _ref.size,
      size = _ref$size === void 0 ? 'medium' : _ref$size,
      title = _ref.title,
      others = (0, _objectWithoutProperties2.default)(_ref, _excluded);
  var classNames = (0, _classnames.default)(_theme.default['wrapper'], _theme.default["is-".concat(size)], (0, _defineProperty2.default)({}, _theme.default['has-pointer'], title), className);
  return /*#__PURE__*/_react.default.createElement(_box.default, (0, _extends2.default)({}, others, {
    alignItems: "center",
    className: classNames,
    display: "flex",
    flexDirection: "column",
    justifyContent: "center",
    textAlign: "center"
  }), title && !hidePointer && /*#__PURE__*/_react.default.createElement("div", {
    className: _theme.default['pointer']
  }, illustrationMap[size]), /*#__PURE__*/_react.default.createElement("div", {
    className: _theme.default['content']
  }, title && /*#__PURE__*/_react.default.createElement(_typography.Heading3, {
    color: "teal"
  }, title), metaText && /*#__PURE__*/_react.default.createElement(_typography.TextBody, {
    marginTop: title ? 2 : undefined,
    color: "neutral"
  }, metaText)));
};

var _default = EmptyState;
exports.default = _default;