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, { useEffect, useState } from 'react' import { parseNumberWithCommas } from '@typebot.io/lib' import { chatsLimit, computePrice, storageLimit } from '@typebot.io/lib/pricing' import { PricingCard } from './PricingCard' export const StarterPlanCard = () => { const [price, setPrice] = useState(39) const [selectedChatsLimitIndex, setSelectedChatsLimitIndex] = useState(0) const [selectedStorageLimitIndex, setSelectedStorageLimitIndex] = useState(0) useEffect(() => { setPrice( computePrice( Plan.STARTER, selectedChatsLimitIndex ?? 0, selectedStorageLimitIndex ?? 0 ) ?? NaN ) }, [selectedChatsLimitIndex, selectedStorageLimitIndex]) return ( 2 seats included , } size="sm" variant="outline" colorScheme="orange" > {parseNumberWithCommas( chatsLimit.STARTER.totalIncluded + chatsLimit.STARTER.increaseStep.amount * selectedChatsLimitIndex )} {selectedChatsLimitIndex !== 0 && ( setSelectedChatsLimitIndex(0)}> {parseNumberWithCommas(chatsLimit.STARTER.totalIncluded)} )} {selectedChatsLimitIndex !== 1 && ( setSelectedChatsLimitIndex(1)}> {parseNumberWithCommas( chatsLimit.STARTER.totalIncluded + chatsLimit.STARTER.increaseStep.amount )} )} {selectedChatsLimitIndex !== 2 && ( setSelectedChatsLimitIndex(2)}> {parseNumberWithCommas( chatsLimit.STARTER.totalIncluded + chatsLimit.STARTER.increaseStep.amount * 2 )} )} {selectedChatsLimitIndex !== 3 && ( setSelectedChatsLimitIndex(3)}> {parseNumberWithCommas( chatsLimit.STARTER.totalIncluded + chatsLimit.STARTER.increaseStep.amount * 3 )} )} {selectedChatsLimitIndex !== 4 && ( setSelectedChatsLimitIndex(4)}> {parseNumberWithCommas( chatsLimit.STARTER.totalIncluded + chatsLimit.STARTER.increaseStep.amount * 4 )} )} {' '} chats/mo , } size="sm" variant="outline" isLoading={selectedStorageLimitIndex === undefined} colorScheme="orange" > {selectedStorageLimitIndex !== undefined ? parseNumberWithCommas( storageLimit.STARTER.totalIncluded + storageLimit.STARTER.increaseStep.amount * selectedStorageLimitIndex ) : undefined} {selectedStorageLimitIndex !== 0 && ( setSelectedStorageLimitIndex(0)}> {parseNumberWithCommas(storageLimit.STARTER.totalIncluded)} )} {selectedStorageLimitIndex !== 1 && ( setSelectedStorageLimitIndex(1)}> {parseNumberWithCommas( storageLimit.STARTER.totalIncluded + storageLimit.STARTER.increaseStep.amount )} )} {selectedStorageLimitIndex !== 2 && ( setSelectedStorageLimitIndex(2)}> {parseNumberWithCommas( storageLimit.STARTER.totalIncluded + storageLimit.STARTER.increaseStep.amount * 2 )} )} {selectedStorageLimitIndex !== 3 && ( setSelectedStorageLimitIndex(3)}> {parseNumberWithCommas( storageLimit.STARTER.totalIncluded + storageLimit.STARTER.increaseStep.amount * 3 )} )} {selectedStorageLimitIndex !== 4 && ( setSelectedStorageLimitIndex(4)}> {parseNumberWithCommas( storageLimit.STARTER.totalIncluded + storageLimit.STARTER.increaseStep.amount * 4 )} )} {' '} GB of storage , 'Branding removed', 'Collect files from users', 'Create folders', ], }} borderWidth="1px" borderColor="orange.200" button={ } /> ) }