mirror of
https://github.com/langgenius/dify.git
synced 2025-07-06 00:31:23 +00:00
33 lines
685 B
TypeScript
33 lines
685 B
TypeScript
![]() |
import cn from '@/utils/classnames'
|
||
|
|
||
|
type FileImageRenderProps = {
|
||
|
imageUrl: string
|
||
|
className?: string
|
||
|
alt?: string
|
||
|
onLoad?: () => void
|
||
|
onError?: () => void
|
||
|
showDownloadAction?: boolean
|
||
|
}
|
||
|
const FileImageRender = ({
|
||
|
imageUrl,
|
||
|
className,
|
||
|
alt,
|
||
|
onLoad,
|
||
|
onError,
|
||
|
showDownloadAction,
|
||
|
}: FileImageRenderProps) => {
|
||
|
return (
|
||
|
<div className={cn('border-[2px] border-effects-image-frame shadow-xs', className)}>
|
||
|
<img
|
||
|
className={cn('w-full h-full object-cover', showDownloadAction && 'cursor-pointer')}
|
||
|
alt={alt}
|
||
|
onLoad={onLoad}
|
||
|
onError={onError}
|
||
|
src={imageUrl}
|
||
|
/>
|
||
|
</div>
|
||
|
)
|
||
|
}
|
||
|
|
||
|
export default FileImageRender
|