-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathOutputTemplateCell.tsx
48 lines (41 loc) · 1.03 KB
/
OutputTemplateCell.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
import type {
FindOutputTemplateById,
FindOutputTemplateByIdVariables,
} from 'types/graphql'
import type {
CellSuccessProps,
CellFailureProps,
TypedDocumentNode,
} from '@redwoodjs/web'
import OutputTemplate from 'src/components/OutputTemplate/OutputTemplate'
export const QUERY: TypedDocumentNode<
FindOutputTemplateById,
FindOutputTemplateByIdVariables
> = gql`
query FindOutputTemplateById($id: Int!) {
outputTemplate: outputTemplate(id: $id) {
id
name
version
effectiveDate
rulesGeneratedAt
createdAt
updatedAt
}
}
`
export const Loading = () => <div>Loading...</div>
export const Empty = () => <div>OutputTemplate not found</div>
export const Failure = ({
error,
}: CellFailureProps<FindOutputTemplateByIdVariables>) => (
<div className="rw-cell-error">{error?.message}</div>
)
export const Success = ({
outputTemplate,
}: CellSuccessProps<
FindOutputTemplateById,
FindOutputTemplateByIdVariables
>) => {
return <OutputTemplate outputTemplate={outputTemplate} />
}