-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathUploadsCell.tsx
56 lines (49 loc) · 1.08 KB
/
UploadsCell.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
44
45
46
47
48
49
50
51
52
53
54
55
56
import type { FindUploads } from 'types/graphql'
import { Link, routes } from '@redwoodjs/router'
import type { CellSuccessProps, CellFailureProps } from '@redwoodjs/web'
import Uploads from 'src/components/Upload/Uploads'
export const QUERY = gql`
query FindUploads {
uploads {
id
filename
uploadedBy {
id
email
}
agency {
id
code
}
expenditureCategory {
id
code
}
latestValidation {
id
createdAt
passed
results
}
createdAt
updatedAt
}
}
`
export const Loading = () => <div>Loading...</div>
export const Empty = () => {
return (
<div className="rw-text-center">
{'No uploads yet. '}
<Link to={routes.newUpload()} className="rw-link">
{'Create one?'}
</Link>
</div>
)
}
export const Failure = ({ error }: CellFailureProps) => (
<div className="rw-cell-error">{error?.message}</div>
)
export const Success = ({ uploads }: CellSuccessProps<FindUploads>) => {
return <Uploads uploads={uploads} />
}