import React from 'react'; import { View } from 'react-native'; import { composerStyles } from '../conversation/composerStyles'; import { FileAttachment } from './FileAttachment'; import { fileTypeFromUrl, getAttachmentName, isImageAttachment } from './mediaUtils'; import type { SuperagentMediaAttachment } from '../../types'; export function AttachmentPreviewStrip({ attachments, onRemove, }: { attachments: SuperagentMediaAttachment[]; onRemove: (index: number) => void; }) { if (attachments.length === 0) return null; return ( {attachments.map((attachment, index) => { // Classify once: prefer the attachment's own kind/mimeType (handles // images with an extensionless URL), fall back to the URL for the chip // icon — so `variant` and `fileType` can't disagree. const isImage = isImageAttachment(attachment); return ( onRemove(index)} /> ); })} ); }