"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 _FeedObject = _interopRequireDefault(require("../../../components/FeedObject"));

var _feedObject = require("../../../types/feedObject");

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

const PREFIX = 'SCPreviewMediaShare';
const classes = {
  sharePreview: `${PREFIX}-share-preview`
};
const Root = (0, _styles.styled)(_Box.default, {
  name: PREFIX,
  slot: 'Root',
  overridesResolver: (props, styles) => styles.root
})(({
  theme
}) => ({
  [`& .${classes.sharePreview}`]: {
    padding: 16
  }
}));

var _default = ({
  medias: _medias = [],
  adornment: _adornment = null
}) => {
  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
    })
  }, /*#__PURE__*/_react.default.createElement(Root, null, _adornment, _medias.map(media => /*#__PURE__*/_react.default.createElement(_Box.default, {
    key: media.id,
    className: classes.sharePreview
  }, /*#__PURE__*/_react.default.createElement(_FeedObject.default, {
    feedObjectId: media.embed.metadata.id,
    feedObjectType: media.embed.metadata.type,
    variant: 'outlined',
    template: _feedObject.SCFeedObjectTemplateType.SHARE
  }))))));
};

exports.default = _default;