import { FileText, X, MessageSquare, Upload } from "lucide-react";
import type { FileAttachment } from "@/ipc/ipc_types";
interface AttachmentsListProps {
attachments: FileAttachment[];
onRemove: (index: number) => void;
}
export function AttachmentsList({
attachments,
onRemove,
}: AttachmentsListProps) {
if (attachments.length === 0) return null;
return (
{attachments.map((attachment, index) => (
{attachment.type === "upload-to-codebase" ? (
) : (
)}
{attachment.file.type.startsWith("image/") ? (
})
URL.revokeObjectURL((e.target as HTMLImageElement).src)
}
onError={(e) =>
URL.revokeObjectURL((e.target as HTMLImageElement).src)
}
/>
})
URL.revokeObjectURL((e.target as HTMLImageElement).src)
}
onError={(e) =>
URL.revokeObjectURL((e.target as HTMLImageElement).src)
}
/>
) : (
)}
{attachment.file.name}
))}
);
}