import React from 'react';
import { ImageVariants } from './types';
import cx from 'classnames';
export var Image = function Image(_ref) {
  var _ref$variant = _ref.variant,
      variant = _ref$variant === void 0 ? ImageVariants.SOLID : _ref$variant,
      src = _ref.src,
      alt = _ref.alt,
      className = _ref.className,
      children = _ref.children;
  var attrs = variant === ImageVariants.BACKGROUND ? {
    style: {
      backgroundImage: "url(".concat(src, ")")
    }
  } : null;
  var isImg = variant === ImageVariants.SOLID;
  return React.createElement("div", Object.assign({}, attrs, {
    className: cx('image-background', className)
  }), isImg ? React.createElement("img", {
    src: src,
    alt: alt
  }) : null, children);
};