import { chakra, Tooltip, Text, Button, HStack, Menu, MenuButton, MenuItem, MenuList, } from '@chakra-ui/react' import { ChevronDownIcon } from 'assets/icons/ChevronDownIcon' import { HelpCircleIcon } from 'assets/icons/HelpCircleIcon' import { Plan } from '@typebot.io/prisma' import Link from 'next/link' import React, { useState } from 'react' import { parseNumberWithCommas } from '@typebot.io/lib' import { chatsLimit, computePrice, seatsLimit, storageLimit, } from '@typebot.io/lib/pricing' import { PricingCard } from './PricingCard' type Props = { isYearly: boolean } export const ProPlanCard = ({ isYearly }: Props) => { const [selectedChatsLimitIndex, setSelectedChatsLimitIndex] = useState(0) const [selectedStorageLimitIndex, setSelectedStorageLimitIndex] = useState(0) const price = computePrice( Plan.PRO, selectedChatsLimitIndex ?? 0, selectedStorageLimitIndex ?? 0, isYearly ? 'yearly' : 'monthly' ) ?? NaN return ( {seatsLimit.PRO.totalIncluded} seats {' '} included , } size="sm" variant="outline" isLoading={selectedChatsLimitIndex === undefined} > {selectedChatsLimitIndex !== undefined ? parseNumberWithCommas( chatsLimit.PRO.graduatedPrice[selectedChatsLimitIndex] .totalIncluded ) : undefined} {chatsLimit.PRO.graduatedPrice.map((price, index) => ( setSelectedChatsLimitIndex(index)} > {parseNumberWithCommas(price.totalIncluded)} ))} {' '} chats/mo , } size="sm" variant="outline" isLoading={selectedStorageLimitIndex === undefined} > {selectedStorageLimitIndex !== undefined ? parseNumberWithCommas( storageLimit.PRO.graduatedPrice[selectedStorageLimitIndex] .totalIncluded ) : undefined} {storageLimit.PRO.graduatedPrice.map((price, index) => ( setSelectedStorageLimitIndex(index)} > {parseNumberWithCommas(price.totalIncluded)} ))} {' '} GB of storage , 'Custom domains', 'In-depth analytics', ], }} borderWidth="3px" borderColor="blue.200" button={ } /> ) }