2
0
Files
bot/packages/billing/getSeatsLimit.ts

13 lines
399 B
TypeScript
Raw Permalink Normal View History

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]
}