mirror of
https://github.com/coder/coder.git
synced 2025-07-12 00:14:10 +00:00
feat: Add the template page (#1754)
This commit is contained in:
@ -1,23 +1,11 @@
|
||||
import { useActor, useMachine } from "@xstate/react"
|
||||
import React, { useContext } from "react"
|
||||
import { useMachine } from "@xstate/react"
|
||||
import React from "react"
|
||||
import { useNavigate, useSearchParams } from "react-router-dom"
|
||||
import { Template } from "../../api/typesGenerated"
|
||||
import { useOrganizationId } from "../../hooks/useOrganizationId"
|
||||
import { createWorkspaceMachine } from "../../xServices/createWorkspace/createWorkspaceXService"
|
||||
import { XServiceContext } from "../../xServices/StateContext"
|
||||
import { CreateWorkspacePageView } from "./CreateWorkspacePageView"
|
||||
|
||||
const useOrganizationId = () => {
|
||||
const xServices = useContext(XServiceContext)
|
||||
const [authState] = useActor(xServices.authXService)
|
||||
const organizationId = authState.context.me?.organization_ids[0]
|
||||
|
||||
if (!organizationId) {
|
||||
throw new Error("No organization ID found")
|
||||
}
|
||||
|
||||
return organizationId
|
||||
}
|
||||
|
||||
const CreateWorkspacePage: React.FC = () => {
|
||||
const organizationId = useOrganizationId()
|
||||
const [searchParams] = useSearchParams()
|
||||
|
Reference in New Issue
Block a user