-
Notifications
You must be signed in to change notification settings - Fork 5
/
Uploads.tsx
43 lines (37 loc) · 918 Bytes
/
Uploads.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
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
import type { FindUploads } from 'types/graphql'
import TableBuilder from 'src/components/TableBuilder/TableBuilder'
import { columnDefs } from './columns'
interface UploadsListProps {
uploads: FindUploads['uploads']
showTreasuryFiles: boolean
onTreasuryFilesChange: () => void
isLoading?: boolean
}
const UploadsList = ({
uploads,
showTreasuryFiles,
onTreasuryFilesChange,
isLoading,
}: UploadsListProps) => {
const filterableInputs = [
'agency_code',
'expenditureCategory_code',
'uploadedBy_email',
'filename',
'reportingPeriod_name',
]
return (
<TableBuilder
data={uploads}
columns={columnDefs}
filterableInputs={filterableInputs}
globalFilter={{
label: 'Only Treasury Files',
checked: showTreasuryFiles,
onChange: onTreasuryFilesChange,
loading: isLoading,
}}
/>
)
}
export default UploadsList