import React from "react"; import _ from "lodash"; import { Button as SButton, Header as SHeader, Image, Modal, ModalActions, ModalContent, ModalHeader } from "semantic-ui-react"; function getMediaPathURL(file) { if (file['primary_path']) { return `/media/${encodeURIComponent(file['primary_path'])}`; } else { return `/media/${encodeURIComponent(file['path'])}`; } } function getDownloadPathURL(file) { if (file['primary_path']) { return `/download/${encodeURIComponent(file['primary_path'])}`; } else { return `/download/${encodeURIComponent(file['path'])}`; } } function getEpubViewerURL(file) { if (file['primary_path']) { return `/epub.html?url=download/${encodeURIComponent(file['primary_path'])}`; } else { return `/epub.html?url=download/${encodeURIComponent(file['path'])}`; } } function getIframeModal(path) { const url = getMediaPathURL(path); return