nur Plan ULTRA kann neue Workspaces zum Dashboard hinzufügen
This commit is contained in:
@ -18,6 +18,8 @@ import {
|
||||
Text,
|
||||
} from '@chakra-ui/react'
|
||||
import { WorkspaceInApp } from '../WorkspaceProvider'
|
||||
import { useWorkspace } from '@/features/workspace/WorkspaceProvider' //für die Planprüfung
|
||||
import { Plan } from '@typebot.io/prisma' //für die Planprüfung
|
||||
|
||||
type Props = {
|
||||
currentWorkspace?: WorkspaceInApp
|
||||
@ -34,6 +36,7 @@ export const WorkspaceDropdown = ({
|
||||
}: Props) => {
|
||||
const { t } = useTranslate()
|
||||
const { data } = trpc.workspace.listWorkspaces.useQuery()
|
||||
const { workspace } = useWorkspace() //für die Planprüfung
|
||||
|
||||
const workspaces = data?.workspaces ?? []
|
||||
|
||||
@ -71,9 +74,11 @@ export const WorkspaceDropdown = ({
|
||||
</HStack>
|
||||
</MenuItem>
|
||||
))}
|
||||
<MenuItem onClick={onCreateNewWorkspaceClick} icon={<PlusIcon />}>
|
||||
{t('workspace.dropdown.newButton.label')}
|
||||
</MenuItem>
|
||||
{workspace?.plan === Plan.UNLIMITED && ( //nur Plan ULTRA kann neue Workspaces zum Dashboard hinzufügen
|
||||
<MenuItem onClick={onCreateNewWorkspaceClick} icon={<PlusIcon />}>
|
||||
{t('workspace.dropdown.newButton.label')}
|
||||
</MenuItem>
|
||||
)}
|
||||
<MenuItem
|
||||
onClick={onLogoutClick}
|
||||
icon={<LogOutIcon />}
|
||||
|
Reference in New Issue
Block a user