"use client"; import { useState } from "react"; import { observer } from "mobx-react"; import Image from "next/image"; import Link from "next/link"; import { useTheme } from "next-themes"; import { IWorkspace } from "@plane/types"; // components import { Button, getButtonStyling } from "@plane/ui"; import { CreateWorkspaceForm } from "@/components/workspace"; // hooks import { useUser, useUserProfile } from "@/hooks/store"; import { useAppRouter } from "@/hooks/use-app-router"; // wrappers import { AuthenticationWrapper } from "@/lib/wrappers"; // plane web helpers import { getIsWorkspaceCreationDisabled } from "@/plane-web/helpers/instance.helper"; // images import BlackHorizontalLogo from "@/public/plane-logos/black-horizontal-with-blue-logo.png"; import WhiteHorizontalLogo from "@/public/plane-logos/white-horizontal-with-blue-logo.png"; import WorkspaceCreationDisabled from "@/public/workspace/workspace-creation-disabled.png"; const CreateWorkspacePage = observer(() => { // router const router = useAppRouter(); // store hooks const { data: currentUser } = useUser(); const { updateUserProfile } = useUserProfile(); // states const [defaultValues, setDefaultValues] = useState({ name: "", slug: "", organization_size: "", }); // hooks const { resolvedTheme } = useTheme(); // derived values const isWorkspaceCreationDisabled = getIsWorkspaceCreationDisabled(); const onSubmit = async (workspace: IWorkspace) => { await updateUserProfile({ last_workspace_id: workspace.id }).then(() => router.push(`/${workspace.slug}`)); }; const logo = resolvedTheme === "light" ? BlackHorizontalLogo : WhiteHorizontalLogo; return (
Plane logo
{currentUser?.email}
{isWorkspaceCreationDisabled ? (
Workspace creation disabled
Only your instance admin can create workspaces

If you know your instance admin's email address,
click the button below to get in touch with them.

Request instance admin
) : (

Create your workspace

)}
); }); export default CreateWorkspacePage;