-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathFileTable.tsx
28 lines (25 loc) · 867 Bytes
/
FileTable.tsx
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
import React from 'react'
interface iFileTableProps {
deleteFile: (index: number) => void;
files: Array<File>;
sortableRef: React.RefObject<HTMLDivElement>;
}
function FileTable({ files, deleteFile, sortableRef }: iFileTableProps) {
return (
<div className='uk-list uk-list-disc' uk-sortable="true" ref={sortableRef}>
{files.map((file: File, index: number) => {
return <>
<li>
<span className='white'>{file.name}</span>
<span
className="uk-icon-button uk-margin-left"
uk-icon="close"
onClick={() => deleteFile(index)}
></span>
</li>
</>
})}
</div>
)
}
export default FileTable