fix multi view image
This commit is contained in:
@@ -25,8 +25,7 @@ const UploadBoxDraggble: FC<Props> = (props: Props) => {
|
||||
|
||||
const onDrop = useCallback((acceptedFiles: File[]) => {
|
||||
if (props.isMultiple) {
|
||||
const array = [...files]
|
||||
array.push(acceptedFiles[0])
|
||||
const array = [...files, ...acceptedFiles]
|
||||
setFiles(array)
|
||||
props.onChange(array)
|
||||
} else {
|
||||
@@ -91,7 +90,7 @@ const UploadBoxDraggble: FC<Props> = (props: Props) => {
|
||||
</div>
|
||||
|
||||
{
|
||||
files.length > 0 || perviews ? (
|
||||
files.length > 0 || perviews.length > 0 ? (
|
||||
<div className='mt-4 flex gap-4 items-center'>
|
||||
{
|
||||
perviews && perviews.map((item, index) => {
|
||||
|
||||
Reference in New Issue
Block a user