import React from 'react' import { Player } from 'video-react' import Img from 'react-image' import Md from './Md' import Spinner from '../presentational/Spinner' import NoSource from '../presentational/NoSource' export default ({ media, viewIdx, translations, switchLanguage, langIdx }) => { const el = document.querySelector(`.source-media-gallery`) const shiftW = el ? el.getBoundingClientRect().width : 0 function renderMedia (media) { let { path, type, poster } = media switch (type) { case 'Image': return (
} unloader={} onClick={() => window.open(path, '_blank')} /> ) case 'Video': return (
{translations ? translations.map((trans, idx) => ( langIdx !== idx + 1 ? (
switchLanguage(idx + 1)}>{trans.code}
) : (
switchLanguage(0)}>EN
) )) : null}
) case 'Text': return (
} unloader={() => this.renderError()} />
) case 'Document': return (