1
1
import { useMachine } from "@xstate/react"
2
2
import { FC } from "react"
3
+ import { Helmet } from "react-helmet"
3
4
import { useNavigate , useSearchParams } from "react-router-dom"
4
5
import { Template } from "../../api/typesGenerated"
5
6
import { useOrganizationId } from "../../hooks/useOrganizationId"
7
+ import { pageTitle } from "../../util/page"
6
8
import { createWorkspaceMachine } from "../../xServices/createWorkspace/createWorkspaceXService"
7
9
import { CreateWorkspacePageView } from "./CreateWorkspacePageView"
8
10
@@ -21,29 +23,34 @@ const CreateWorkspacePage: FC = () => {
21
23
} )
22
24
23
25
return (
24
- < CreateWorkspacePageView
25
- loadingTemplates = { createWorkspaceState . matches ( "gettingTemplates" ) }
26
- loadingTemplateSchema = { createWorkspaceState . matches ( "gettingTemplateSchema" ) }
27
- creatingWorkspace = { createWorkspaceState . matches ( "creatingWorkspace" ) }
28
- templates = { createWorkspaceState . context . templates }
29
- selectedTemplate = { createWorkspaceState . context . selectedTemplate }
30
- templateSchema = { createWorkspaceState . context . templateSchema }
31
- onCancel = { ( ) => {
32
- navigate ( preSelectedTemplateName ? "/templates" : "/workspaces" )
33
- } }
34
- onSubmit = { ( request ) => {
35
- send ( {
36
- type : "CREATE_WORKSPACE" ,
37
- request,
38
- } )
39
- } }
40
- onSelectTemplate = { ( template : Template ) => {
41
- send ( {
42
- type : "SELECT_TEMPLATE" ,
43
- template,
44
- } )
45
- } }
46
- />
26
+ < >
27
+ < Helmet >
28
+ < title > { pageTitle ( "Create Workspace" ) } </ title >
29
+ </ Helmet >
30
+ < CreateWorkspacePageView
31
+ loadingTemplates = { createWorkspaceState . matches ( "gettingTemplates" ) }
32
+ loadingTemplateSchema = { createWorkspaceState . matches ( "gettingTemplateSchema" ) }
33
+ creatingWorkspace = { createWorkspaceState . matches ( "creatingWorkspace" ) }
34
+ templates = { createWorkspaceState . context . templates }
35
+ selectedTemplate = { createWorkspaceState . context . selectedTemplate }
36
+ templateSchema = { createWorkspaceState . context . templateSchema }
37
+ onCancel = { ( ) => {
38
+ navigate ( preSelectedTemplateName ? "/templates" : "/workspaces" )
39
+ } }
40
+ onSubmit = { ( request ) => {
41
+ send ( {
42
+ type : "CREATE_WORKSPACE" ,
43
+ request,
44
+ } )
45
+ } }
46
+ onSelectTemplate = { ( template : Template ) => {
47
+ send ( {
48
+ type : "SELECT_TEMPLATE" ,
49
+ template,
50
+ } )
51
+ } }
52
+ />
53
+ </ >
47
54
)
48
55
}
49
56
0 commit comments