import React from 'react'; import { Icon } from 'soapbox/components/ui'; import { MIMETYPE_ICONS } from 'soapbox/components/upload'; import type { Attachment } from 'soapbox/types/entities'; const defaultIcon = require('@tabler/icons/paperclip.svg'); interface IChatUploadPreview { className?: string attachment: Attachment } /** * Displays a generic preview for an upload depending on its media type. * It fills its container and is expected to be sized by its parent. */ const ChatUploadPreview: React.FC = ({ className, attachment }) => { const mimeType = attachment.pleroma.get('mime_type') as string | undefined; switch (attachment.type) { case 'image': return ( ); case 'video': return (