()
| 70 | ] |
| 71 | |
| 72 | function NewWorkflowUI() { |
| 73 | const getSettingsQuery = useQuery({ |
| 74 | queryKey: ['settings'], |
| 75 | queryFn: async () => { |
| 76 | const response = await fetch(`/api/settings`) |
| 77 | const data = await response.json() |
| 78 | return data as Settings |
| 79 | }, |
| 80 | }) |
| 81 | |
| 82 | if (getSettingsQuery.isError) { |
| 83 | return <div>Something went wrong, please refresh the page.</div> |
| 84 | } |
| 85 | |
| 86 | if (getSettingsQuery.isLoading || !getSettingsQuery.data) { |
| 87 | return <div>Loading...</div> |
| 88 | } |
| 89 | |
| 90 | return ( |
| 91 | <div className="flex flex-col p-10"> |
| 92 | <div> |
| 93 | <h1 className="text-3xl font-semibold">New workflow</h1> |
| 94 | </div> |
| 95 | <div className="flex flex-col mt-10"> |
| 96 | <div> |
| 97 | <Masonry |
| 98 | itemKey={(item) => item.id} |
| 99 | columnGutter={20} |
| 100 | columnWidth={350} |
| 101 | items={workflowTemplates} |
| 102 | render={(props) => ( |
| 103 | <WorkflowTemplate settings={getSettingsQuery.data} item={props.data} /> |
| 104 | )} |
| 105 | /> |
| 106 | </div> |
| 107 | </div> |
| 108 | </div> |
| 109 | ) |
| 110 | } |
| 111 | |
| 112 | export default NewWorkflowUI |
nothing calls this directly
no outgoing calls
no test coverage detected