MCPcopy Create free account
hub / github.com/ComfyWorkflows/ComfyUI-Launcher / NewWorkflowUI

Function NewWorkflowUI

web/src/components/NewWorkflowUI.tsx:72–110  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

70]
71
72function 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
112export default NewWorkflowUI

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected