diff --git a/apps/sim/app/workspace/[workspaceId]/w/components/sidebar/components/workspace-header/components/create-workspace-modal/create-workspace-modal.test.ts b/apps/sim/app/workspace/[workspaceId]/w/components/sidebar/components/workspace-header/components/create-workspace-modal/create-workspace-modal.test.ts deleted file mode 100644 index 5761a060f9e..00000000000 --- a/apps/sim/app/workspace/[workspaceId]/w/components/sidebar/components/workspace-header/components/create-workspace-modal/create-workspace-modal.test.ts +++ /dev/null @@ -1,26 +0,0 @@ -/** - * @vitest-environment node - */ -import { describe, expect, it } from 'vitest' -import { getCreateWorkspaceCopy } from '@/app/workspace/[workspaceId]/w/components/sidebar/components/workspace-header/components/create-workspace-modal/create-workspace-modal' - -describe('getCreateWorkspaceCopy', () => { - it('labels viewer-account personal creation explicitly', () => { - expect(getCreateWorkspaceCopy({ type: 'personal' })).toEqual({ - title: 'Create personal workspace', - description: 'This workspace will belong to your personal account.', - }) - }) - - it('names the viewer active organization as the creation target', () => { - expect( - getCreateWorkspaceCopy({ - type: 'organization', - organizationName: 'Viewer Org A', - }) - ).toEqual({ - title: 'Create workspace in Viewer Org A', - description: 'This workspace will belong to Viewer Org A and use its workspace policy.', - }) - }) -}) diff --git a/apps/sim/app/workspace/[workspaceId]/w/components/sidebar/components/workspace-header/components/create-workspace-modal/create-workspace-modal.tsx b/apps/sim/app/workspace/[workspaceId]/w/components/sidebar/components/workspace-header/components/create-workspace-modal/create-workspace-modal.tsx index 2b6fcb5dda3..4d6f942010f 100644 --- a/apps/sim/app/workspace/[workspaceId]/w/components/sidebar/components/workspace-header/components/create-workspace-modal/create-workspace-modal.tsx +++ b/apps/sim/app/workspace/[workspaceId]/w/components/sidebar/components/workspace-header/components/create-workspace-modal/create-workspace-modal.tsx @@ -11,30 +11,13 @@ import { } from '@sim/emcn' import { getErrorMessage } from '@sim/utils/errors' -export type CreateWorkspaceTarget = - | { type: 'personal' } - | { type: 'organization'; organizationName: string } - -export function getCreateWorkspaceCopy(target: CreateWorkspaceTarget) { - if (target.type === 'organization') { - return { - title: `Create workspace in ${target.organizationName}`, - description: `This workspace will belong to ${target.organizationName} and use its workspace policy.`, - } - } - - return { - title: 'Create personal workspace', - description: 'This workspace will belong to your personal account.', - } -} +const TITLE = 'Create workspace' interface CreateWorkspaceModalProps { open: boolean onOpenChange: (open: boolean) => void onConfirm: (name: string) => Promise isCreating: boolean - target: CreateWorkspaceTarget } /** @@ -45,7 +28,6 @@ export function CreateWorkspaceModal({ onOpenChange, onConfirm, isCreating, - target, }: CreateWorkspaceModalProps) { const [name, setName] = useState('') const [error, setError] = useState(null) @@ -74,13 +56,10 @@ export function CreateWorkspaceModal({ setError(null) } - const copy = getCreateWorkspaceCopy(target) - return ( - - onOpenChange(false)}>{copy.title} + + onOpenChange(false)}>{TITLE} -

{copy.description}