"use strict";

exports.__esModule = true;
exports.default = void 0;

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

var _styles = require("@mui/material/styles");

var _reactLazyload = _interopRequireDefault(require("react-lazyload"));

var _CentralProgress = _interopRequireDefault(require("../../CentralProgress"));

var _Box = _interopRequireDefault(require("@mui/material/Box"));

var _AutoPlayer = _interopRequireDefault(require("../../AutoPlayer"));

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

const PREFIX = 'SCPreviewMediaVideo';
const Root = (0, _styles.styled)(_Box.default, {
  name: PREFIX,
  slot: 'Root',
  overridesResolver: (props, styles) => styles.root
})(({
  theme
}) => ({}));

var _default = props => {
  // PROPS
  const {
    medias = [],
    adornment = null
  } = props;
  /**
   * Renders Video preview
   */

  return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, medias.length > 0 && /*#__PURE__*/_react.default.createElement(_reactLazyload.default, {
    height: 360,
    placeholder: /*#__PURE__*/_react.default.createElement(_CentralProgress.default, {
      size: 20
    }),
    once: true
  }, /*#__PURE__*/_react.default.createElement(Root, null, adornment, medias.map((v, i) => /*#__PURE__*/_react.default.createElement(_reactLazyload.default, {
    height: 360,
    placeholder: /*#__PURE__*/_react.default.createElement(_CentralProgress.default, {
      size: 20
    }),
    key: i,
    once: true
  }, /*#__PURE__*/_react.default.createElement(_AutoPlayer.default, {
    url: v.url,
    width: '100%'
  }))))));
};

exports.default = _default;