import _extends from "@babel/runtime/helpers/extends";
import _defineProperty from "@babel/runtime/helpers/defineProperty";
import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
var _excluded = ["className", "metaText", "hidePointer", "size", "title"];
import React from 'react';
import Box from '../box';
import cx from 'classnames';
import { IllustrationEmptyState36X36Pointer, IllustrationEmptyState48X48Pointer, IllustrationEmptyState130X130Pointer } from '@teamleader/ui-illustrations';
import { Heading3, TextBody } from '../typography';
import theme from './theme.css';
var illustrationMap = {
  small: /*#__PURE__*/React.createElement(IllustrationEmptyState36X36Pointer, null),
  medium: /*#__PURE__*/React.createElement(IllustrationEmptyState48X48Pointer, null),
  large: /*#__PURE__*/React.createElement(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 = _objectWithoutProperties(_ref, _excluded);

  var classNames = cx(theme['wrapper'], theme["is-".concat(size)], _defineProperty({}, theme['has-pointer'], title), className);
  return /*#__PURE__*/React.createElement(Box, _extends({}, others, {
    alignItems: "center",
    className: classNames,
    display: "flex",
    flexDirection: "column",
    justifyContent: "center",
    textAlign: "center"
  }), title && !hidePointer && /*#__PURE__*/React.createElement("div", {
    className: theme['pointer']
  }, illustrationMap[size]), /*#__PURE__*/React.createElement("div", {
    className: theme['content']
  }, title && /*#__PURE__*/React.createElement(Heading3, {
    color: "teal"
  }, title), metaText && /*#__PURE__*/React.createElement(TextBody, {
    marginTop: title ? 2 : undefined,
    color: "neutral"
  }, metaText)));
};

export default EmptyState;