"use strict";

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

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

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

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

var _Box = require("../Box");

var _Image = require("../Image");

var _styles = _interopRequireDefault(require("./styles"));

var __jsx = _react["default"].createElement;

function VibrantShadow(props) {
  var srcset = props.srcset,
      image = props.image,
      key = props.key,
      sizes = props.sizes,
      _props$vibrancy = props.vibrancy,
      vibrancy = _props$vibrancy === void 0 ? 1 : _props$vibrancy,
      _props$opacity = props.opacity,
      opacity = _props$opacity === void 0 ? 0.9 : _props$opacity,
      _props$radius = props.radius,
      radius = _props$radius === void 0 ? 15 : _props$radius,
      _props$size = props.size,
      size = _props$size === void 0 ? 0.98 : _props$size,
      _props$offset = props.offset,
      offset = _props$offset === void 0 ? {} : _props$offset;

  var _useVibrantShadowStyl = (0, _styles["default"])({
    offset: offset,
    opacity: opacity,
    size: size,
    radius: radius,
    vibrancy: vibrancy
  }),
      containerStyleProps = _useVibrantShadowStyl.root,
      imageStyleProps = _useVibrantShadowStyl.image,
      shadowStyleProps = _useVibrantShadowStyl.shadow;

  if (!image) return null;
  return __jsx(_Box.Box, containerStyleProps, __jsx(_Image.Image, (0, _extends2["default"])({
    src: image,
    sizes: sizes,
    key: key,
    srcSet: srcset,
    alt: ""
  }, imageStyleProps)), __jsx(_Image.Image, (0, _extends2["default"])({
    alt: "",
    src: image,
    key: key,
    sizes: sizes,
    srcSet: srcset
  }, shadowStyleProps)));
}
//# sourceMappingURL=VibrantShadow.js.map