import Image from 'next/image' import ClearIcon from '@/assets/images/clear.svg' import RefreshIcon from '@/assets/images/refresh.svg' import { FileItem } from '@/lib/bots/bing/types' import { cn } from '@/lib/utils' import { useBing } from '@/lib/hooks/use-bing' type ChatAttachmentsProps = Pick, 'attachmentList' | 'setAttachmentList' | 'uploadImage'> export function ChatAttachments({ attachmentList = [], setAttachmentList, uploadImage }: ChatAttachmentsProps) { return attachmentList.length ? (
{attachmentList.map(file => (
{file.status === 'loading' && (
) } {file.status !== 'error' && (
) } {file.status === 'error' && (
refresh uploadImage(file.url)} />
)}
))}
) : null }