// tslint:disable:react-a11y-anchors
import React from 'react';
import * as GoogleChrome from '../util/GoogleChrome';
import { AttachmentType } from '../types/Attachment';
type Props = {
attachment: AttachmentType;
url: string;
caption?: string;
onSave: (caption: string) => void;
onClose: () => void;
};
const CaptionEditorObject = (props: Props) => {
const { url, onClose, attachment } = props;
const { contentType } = attachment || { contentType: null };
const isImageTypeSupported = GoogleChrome.isImageTypeSupported(contentType);
if (isImageTypeSupported) {
return (
);
}
const isVideoTypeSupported = GoogleChrome.isVideoTypeSupported(contentType);
if (isVideoTypeSupported) {
return (
);
}
return