1
- import { useState } from " react" ;
2
- import { useDropZone } from " ./useDropZone" ;
1
+ import { useState } from ' react' ;
2
+ import { useDropZone } from ' ./useDropZone' ;
3
3
4
4
interface FileMeta {
5
5
name : string ;
@@ -21,7 +21,7 @@ const Demo = () => {
21
21
name : file . name ,
22
22
size : file . size ,
23
23
type : file . type ,
24
- lastModified : file . lastModified ,
24
+ lastModified : file . lastModified
25
25
} ) )
26
26
) ;
27
27
} ;
@@ -33,38 +33,32 @@ const Demo = () => {
33
33
< p > Drop files from your computer on to drop zones</ p >
34
34
< div
35
35
ref = { dropZone . ref }
36
- className = " flex flex-col p-5 w-full min-h-[300px] bg-gray-400/10 mt-6 rounded"
36
+ className = ' flex flex-col p-5 w-full min-h-[300px] bg-gray-400/10 mt-6 rounded'
37
37
>
38
- < div className = " m-auto" >
39
- < p className = " text-xl font-bold" > Drop Zone</ p >
38
+ < div className = ' m-auto' >
39
+ < p className = ' text-xl font-bold' > Drop Zone</ p >
40
40
< p >
41
- isOver:{ " " }
42
- < span
43
- className = { dropZone . isOver ? "text-green-500" : "text-red-500" }
44
- >
41
+ isOver:{ ' ' }
42
+ < span className = { dropZone . isOver ? 'text-green-500' : 'text-red-500' } >
45
43
{ String ( dropZone . isOver ) }
46
44
</ span >
47
45
</ p >
48
46
</ div >
49
- < div className = " flex flex-col gap-3" >
47
+ < div className = ' flex flex-col gap-3' >
50
48
{ ! ! files . length &&
51
49
files . map ( ( file , index ) => (
52
- < div
53
- key = { index }
54
- className = "flex p-5 bg-gray-400/5 flex-col rounded"
55
- >
50
+ < div key = { index } className = 'flex p-5 bg-gray-400/5 flex-col rounded' >
56
51
< p >
57
- < span className = " font-bold" > File name:</ span > { file . name }
52
+ < span className = ' font-bold' > File name:</ span > { file . name }
58
53
</ p >
59
54
< p >
60
- < span className = " font-bold" > Size:</ span > { file . size }
55
+ < span className = ' font-bold' > Size:</ span > { file . size }
61
56
</ p >
62
57
< p >
63
- < span className = " font-bold" > Type:</ span > { file . type }
58
+ < span className = ' font-bold' > Type:</ span > { file . type }
64
59
</ p >
65
60
< p >
66
- < span className = "font-bold" > Last modified:</ span > { " " }
67
- { file . lastModified }
61
+ < span className = 'font-bold' > Last modified:</ span > { file . lastModified }
68
62
</ p >
69
63
</ div >
70
64
) ) }
0 commit comments