fix multi view image

This commit is contained in:
hamid zarghami
2025-10-27 12:03:40 +03:30
parent 296ede46c9
commit 461ebfc35b
+2 -3
View File
@@ -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) => {