mirror of https://github.com/langgenius/dify.git
fix: file type icon
This commit is contained in:
parent
49972939a9
commit
466ac987f5
|
|
@ -38,7 +38,7 @@ const FileImageItem = ({
|
|||
/>
|
||||
{
|
||||
progress > 0 && progress < 100 && (
|
||||
<div className='absolute inset-0 flex items-center justify-center border-[2px] border-effects-image-frame bg-background-overlay-alt'>
|
||||
<div className='absolute inset-0 flex items-center justify-center border-[2px] border-effects-image-frame bg-background-overlay-alt z-10'>
|
||||
<ProgressCircle
|
||||
percentage={progress}
|
||||
size={12}
|
||||
|
|
@ -51,7 +51,7 @@ const FileImageItem = ({
|
|||
}
|
||||
{
|
||||
progress === -1 && (
|
||||
<div className='absolute inset-0 flex items-center justify-center border-[2px] border-state-destructive-border bg-background-overlay-destructive'>
|
||||
<div className='absolute inset-0 flex items-center justify-center border-[2px] border-state-destructive-border bg-background-overlay-destructive z-10'>
|
||||
<ReplayLine
|
||||
className='w-5 h-5'
|
||||
onClick={() => onReUpload?.(fileId)}
|
||||
|
|
|
|||
|
|
@ -39,22 +39,22 @@ export const fileUpload: FileUpload = ({
|
|||
|
||||
export const getFileAppearanceType = (file?: File) => {
|
||||
if (!file)
|
||||
return FileAppearanceTypeEnum.OTHER
|
||||
return FileAppearanceTypeEnum.custom
|
||||
const mimeType = file.type
|
||||
|
||||
if (mimeType.includes('image'))
|
||||
return FileAppearanceTypeEnum.IMAGE
|
||||
return FileAppearanceTypeEnum.image
|
||||
|
||||
if (mimeType.includes('video'))
|
||||
return FileAppearanceTypeEnum.VIDEO
|
||||
return FileAppearanceTypeEnum.video
|
||||
|
||||
if (mimeType.includes('audio'))
|
||||
return FileAppearanceTypeEnum.AUDIO
|
||||
return FileAppearanceTypeEnum.audio
|
||||
|
||||
if (mimeType.includes('pdf'))
|
||||
return FileAppearanceTypeEnum.PDF
|
||||
return FileAppearanceTypeEnum.pdf
|
||||
|
||||
return FileAppearanceTypeEnum.OTHER
|
||||
return FileAppearanceTypeEnum.custom
|
||||
}
|
||||
|
||||
export const isImage = (file?: File) => {
|
||||
|
|
|
|||
Loading…
Reference in New Issue