import { useState } from "react"; // ui import { Button } from "@plane/ui"; // types import { IUser, IWorkspace, TOnboardingSteps } from "types"; // constants import { CreateWorkspaceForm } from "components/workspace"; type Props = { finishOnboarding: () => Promise; stepChange: (steps: Partial) => Promise; updateLastWorkspace: () => Promise; user: IUser | undefined; workspaces: IWorkspace[] | undefined; }; export const Workspace: React.FC = (props) => { const { finishOnboarding, stepChange, updateLastWorkspace, user, workspaces } = props; const [defaultValues, setDefaultValues] = useState({ name: "", slug: "", organization_size: "", }); const completeStep = async () => { if (!user) return; const payload: Partial = { workspace_create: true, }; await stepChange(payload); await updateLastWorkspace(); }; const secondaryButtonAction = async () => { if (workspaces && workspaces.length > 0) { await stepChange({ workspace_create: true, workspace_invite: true, workspace_join: true }); await finishOnboarding(); } else await stepChange({ profile_complete: false, workspace_join: false }); }; return (

Create your workspace

{workspaces.length > 0 ? "Skip & continue" : "Back"} ) : undefined } />
); };