import React from 'react'; import { Utils, Actions, AttachmentStore, Message } from 'mailspring-exports'; import { AttachmentItem, ImageAttachmentItem } from 'mailspring-component-kit'; export const AttachmentsArea: React.FunctionComponent<{ draft: Message }> = props => { const { files, headerMessageId } = props.draft; return (
{files .filter(f => !Utils.shouldDisplayAsImage(f)) .map(file => ( Actions.removeAttachment(headerMessageId, file)} /> ))} {files .filter(f => Utils.shouldDisplayAsImage(f)) .filter(f => !f.contentId) .map(file => ( Actions.removeAttachment(headerMessageId, file)} /> ))}
); };