import React from 'react'; import { AttachmentType, getExtensionForDisplay } from '../../types/Attachment'; interface Props { attachment: AttachmentType; onClose: (attachment: AttachmentType) => void; } export class StagedGenericAttachment extends React.Component { public render() { const { attachment, onClose } = this.props; const { fileName, contentType } = attachment; const extension = getExtensionForDisplay({ contentType, fileName }); return (
{ if (onClose) { onClose(attachment); } }} />
{extension ? (
{extension}
) : null}
{fileName}
); } }