2
0

♻️ Remove storage limit related code

This commit is contained in:
Baptiste Arnaud
2023-09-20 16:06:53 +02:00
parent 7d57e8dd06
commit d7dc5fb5fb
25 changed files with 44 additions and 493 deletions

View File

@@ -15,12 +15,7 @@ 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 { chatsLimit, computePrice, seatsLimit } from '@typebot.io/lib/pricing'
import { PricingCard } from './PricingCard'
type Props = {
@@ -30,14 +25,11 @@ type Props = {
export const ProPlanCard = ({ isYearly }: Props) => {
const [selectedChatsLimitIndex, setSelectedChatsLimitIndex] =
useState<number>(0)
const [selectedStorageLimitIndex, setSelectedStorageLimitIndex] =
useState<number>(0)
const price =
computePrice(
Plan.PRO,
selectedChatsLimitIndex ?? 0,
selectedStorageLimitIndex ?? 0,
isYearly ? 'yearly' : 'monthly'
) ?? NaN
@@ -93,46 +85,6 @@ export const ProPlanCard = ({ isYearly }: Props) => {
</chakra.span>
</Tooltip>
</HStack>,
<HStack key="storage" spacing={1.5}>
<Menu>
<MenuButton
as={Button}
rightIcon={<ChevronDownIcon />}
size="sm"
variant="outline"
isLoading={selectedStorageLimitIndex === undefined}
>
{selectedStorageLimitIndex !== undefined
? parseNumberWithCommas(
storageLimit.PRO.graduatedPrice[selectedStorageLimitIndex]
.totalIncluded
)
: undefined}
</MenuButton>
<MenuList>
{storageLimit.PRO.graduatedPrice.map((price, index) => (
<MenuItem
key={index}
onClick={() => setSelectedStorageLimitIndex(index)}
>
{parseNumberWithCommas(price.totalIncluded)}
</MenuItem>
))}
</MenuList>
</Menu>{' '}
<Text>GB of storage</Text>
<Tooltip
hasArrow
placement="top"
label="You accumulate storage for every file that your user upload
into your bot. If you delete the result, it will free up the
space."
>
<chakra.span cursor="pointer" h="7">
<HelpCircleIcon />
</chakra.span>
</Tooltip>
</HStack>,
'Custom domains',
'In-depth analytics',
],
@@ -142,7 +94,7 @@ export const ProPlanCard = ({ isYearly }: Props) => {
button={
<Button
as={Link}
href={`https://app.typebot.io/register?subscribePlan=${Plan.PRO}&chats=${selectedChatsLimitIndex}&storage=${selectedStorageLimitIndex}&isYearly=${isYearly}`}
href={`https://app.typebot.io/register?subscribePlan=${Plan.PRO}&chats=${selectedChatsLimitIndex}&isYearly=${isYearly}`}
colorScheme="blue"
size="lg"
w="full"