import type { Medium } from '@memori.ai/memori-api-client/dist/types'; import React from 'react'; import { getResourceUrl } from '../../helpers/media'; import { prismSyntaxLangs } from '../../helpers/constants'; import { stripHTML, stripDocumentAttachmentTags } from '../../helpers/utils'; import Snippet from '../Snippet/Snippet'; import ContentPreviewModal from '../ContentPreviewModal'; import ModelViewer from '../CustomGLBModelViewer/ModelViewer'; import { IMAGE_MIME_TYPES, getImageDisplaySource, } from './MediaItemWidget.utils'; /* * Media types handled in MediaPreviewModal and recommended UX: * * 1. IMAGES (image/jpeg, image/png, image/jpg, image/gif) * → Full-size in modal with title. Object-fit contain, optional alt. * * 2. CODE (text/javascript, text/ecmascript, application/json, text/css, application/xml, * application/x-sh, text/x-python, text/x-c++src, application/x-php, text/x-ruby, text/x-sql) * → Snippet with syntax highlighting and copy button. * * 3. PDF (application/pdf) * → Inline iframe preview; base64 or resource URL. * * 4. EXCEL (application/vnd.ms-excel, application/vnd.openxmlformats-officedocument.spreadsheetml.sheet) * → Inline iframe preview; base64 or resource URL. * * 5. HTML WITH CONTENT (text/html + content) * → Snippet showing stripped HTML as plain text. * * 6. HTML LINK (text/html + url only) * → Iframe loading the URL (https normalized). * * 7. VIDEO (video/mp4, video/quicktime, video/avi, video/mpeg) * → Native