import { Modal, ModalOverlay, ModalContent, ModalHeader, ModalCloseButton, ModalBody, Stack, ModalFooter, Heading, Table, TableContainer, Tbody, Td, Th, Thead, Tr, } from '@chakra-ui/react' import { proChatTiers } from '@typebot.io/billing/constants' import { formatPrice } from '@typebot.io/billing/helpers/formatPrice' type Props = { isOpen: boolean onClose: () => void } export const ChatsProTiersModal = ({ isOpen, onClose }: Props) => { return ( Chats pricing table {proChatTiers.map((tier, index) => { const pricePerMonth = (tier.flat_amount ?? proChatTiers.at(-2)?.flat_amount ?? 0) / 100 return ( ) })}
Max chats Price per month Price per 1k chats
{tier.up_to === 'inf' ? '2,000,000+' : tier.up_to.toLocaleString()} {index === 0 ? 'included' : formatPrice(pricePerMonth)} {index === proChatTiers.length - 1 ? formatPrice(4.42, { maxFractionDigits: 2 }) : index === 0 ? 'included' : formatPrice( (((pricePerMonth * 100) / ((tier.up_to as number) - (proChatTiers.at(0)?.up_to as number))) * 1000) / 100, { maxFractionDigits: 2 } )}
) }