2
0
Files
bot/ee/packages/billing/helpers/getSeatsLimit.ts
2024-05-23 10:42:23 +02:00

13 lines
400 B
TypeScript

import { Workspace } from '@typebot.io/schemas'
import { seatsLimits } from '../constants'
import { Plan } from '@typebot.io/prisma'
export const getSeatsLimit = ({
plan,
customSeatsLimit,
}: Pick<Workspace, 'plan' | 'customSeatsLimit'>) => {
if (plan === Plan.UNLIMITED) return 'inf'
if (plan === Plan.CUSTOM) return customSeatsLimit ? customSeatsLimit : 'inf'
return seatsLimits[plan]
}