mirror of
https://github.com/langgenius/dify.git
synced 2024-11-16 03:32:23 +08:00
fix: lint
This commit is contained in:
parent
91e5882814
commit
181572e330
|
@ -1,7 +1,5 @@
|
|||
'use client'
|
||||
|
||||
const MAX_FILE_SIZE = 5 * 1024 * 1024; // 5MB
|
||||
|
||||
import type { ChangeEvent, FC } from 'react'
|
||||
import { createRef, useEffect, useState } from 'react'
|
||||
import type { Area } from 'react-easy-crop'
|
||||
|
@ -12,6 +10,8 @@ import { ImagePlus } from '../icons/src/vender/line/images'
|
|||
import { useDraggableUploader } from './hooks'
|
||||
import { ALLOW_FILE_EXTENSIONS } from '@/types/app'
|
||||
|
||||
const MAX_FILE_SIZE = 5 * 1024 * 1024
|
||||
|
||||
type UploaderProps = {
|
||||
className?: string
|
||||
onImageCropped?: (tempUrl: string, croppedAreaPixels: Area, fileName: string) => void
|
||||
|
@ -40,9 +40,8 @@ const Uploader: FC<UploaderProps> = ({
|
|||
|
||||
const handleLocalFileInput = (e: ChangeEvent<HTMLInputElement>) => {
|
||||
const file = e.target.files?.[0]
|
||||
if (file && ALLOW_FILE_EXTENSIONS.includes(file.type.split('/').pop()?.toLowerCase() || '') && file.size <= MAX_FILE_SIZE) {
|
||||
if (file && ALLOW_FILE_EXTENSIONS.includes(file.type.split('/').pop()?.toLowerCase() || '') && file.size <= MAX_FILE_SIZE)
|
||||
setInputImage({ file, url: URL.createObjectURL(file) })
|
||||
}
|
||||
}
|
||||
|
||||
const {
|
||||
|
|
Loading…
Reference in New Issue
Block a user