import React, { useState } from 'react' import { RiArrowRightSLine } from '@remixicon/react' import FileImageRender from './file-image-render' import FileTypeIcon from './file-type-icon' import FileItem from './file-uploader-in-attachment/file-item' import type { FileEntity } from './types' import { getFileAppearanceType, } from './utils' import Tooltip from '@/app/components/base/tooltip' import { SupportUploadFileTypes } from '@/app/components/workflow/types' import cn from '@/utils/classnames' type Props = { fileList: FileEntity[] } const FileListInLog = ({ fileList }: Props) => { const [expanded, setExpanded] = useState(false) if (!fileList.length) return null return (
{expanded && (
)} {!expanded && (
{fileList.map((file) => { const { id, name, type, supportFileType, base64Url, url } = file const isImageFile = supportFileType === SupportUploadFileTypes.image return ( <> {isImageFile && (
)} {!isImageFile && (
)} ) })}
)}
setExpanded(!expanded)}> {!expanded &&
DETAIL
}
{expanded && (
{fileList.map(file => ( ))}
)}
) } export default FileListInLog