import React from 'react';
import { Attachment, QuotePropsWithoutListener } from './Quote';
import { GoogleChrome } from '../../../../../util';
import { MIME } from '../../../../../types';
import { noop } from 'lodash';
import { QuoteImage } from './QuoteImage';
import classNames from 'classnames';
function getObjectUrl(thumbnail: Attachment | undefined): string | undefined {
if (thumbnail && thumbnail.objectUrl) {
return thumbnail.objectUrl;
}
return;
}
const QuoteIcon = (props: any) => {
const { icon } = props;
return (
);
};
export const QuoteIconContainer = (
props: Pick & {
handleImageErrorBound: () => void;
imageBroken: boolean;
}
) => {
const { attachment, imageBroken, handleImageErrorBound } = props;
if (!attachment) {
return null;
}
const { contentType, thumbnail } = attachment;
const objectUrl = getObjectUrl(thumbnail);
if (GoogleChrome.isVideoTypeSupported(contentType)) {
return objectUrl && !imageBroken ? (
) : (
);
}
if (GoogleChrome.isImageTypeSupported(contentType)) {
return objectUrl && !imageBroken ? (
) : (
);
}
if (MIME.isAudio(contentType)) {
return ;
}
return null;
};