import { chakra, Tooltip, Text, HStack, Menu, MenuButton, Button, 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 StarterPlanCard = ({ isYearly }: Props) => { const [selectedChatsLimitIndex, setSelectedChatsLimitIndex] = useState(0) const [selectedStorageLimitIndex, setSelectedStorageLimitIndex] = useState(0) const price = computePrice( Plan.STARTER, selectedChatsLimitIndex ?? 0, selectedStorageLimitIndex ?? 0, isYearly ? 'yearly' : 'monthly' ) ?? NaN return ( {seatsLimit.STARTER.totalIncluded} seats {' '} included , } size="sm" variant="outline" colorScheme="orange" > {parseNumberWithCommas( chatsLimit.STARTER.graduatedPrice[selectedChatsLimitIndex] .totalIncluded )} {chatsLimit.STARTER.graduatedPrice.map((price, index) => ( setSelectedChatsLimitIndex(index)} > {parseNumberWithCommas(price.totalIncluded)} ))} {' '} chats/mo , } size="sm" variant="outline" isLoading={selectedStorageLimitIndex === undefined} colorScheme="orange" > {selectedStorageLimitIndex !== undefined ? parseNumberWithCommas( storageLimit.STARTER.graduatedPrice[ selectedStorageLimitIndex ].totalIncluded ) : undefined} {storageLimit.STARTER.graduatedPrice.map((price, index) => ( setSelectedStorageLimitIndex(index)} > {parseNumberWithCommas(price.totalIncluded)} ))} {' '} GB of storage , 'Branding removed', 'Collect files from users', 'Create folders', ], }} borderWidth="1px" borderColor="orange.200" button={ } /> ) }