🚸 (billing) Improve feedback when subscription is "past_due"

This commit is contained in:
Baptiste Arnaud
2023-09-12 13:17:14 +02:00
parent 6375a2425f
commit 0ccc2efa45
11 changed files with 86 additions and 33 deletions

View File

@@ -1,4 +1,11 @@
import { Text, HStack, Stack, Heading } from '@chakra-ui/react'
import {
Text,
HStack,
Stack,
Heading,
Alert,
AlertIcon,
} from '@chakra-ui/react'
import { Plan } from '@typebot.io/prisma'
import React from 'react'
import { PlanTag } from './PlanTag'
@@ -35,8 +42,21 @@ export const CurrentSubscriptionSummary = ({ workspace }: Props) => {
</Text>
)}
</HStack>
{data?.subscription?.status === 'past_due' && (
<Alert fontSize="sm" status="error">
<AlertIcon />
{scopedT('pastDueAlert')}
</Alert>
)}
{isSubscribed && <BillingPortalButton workspaceId={workspace.id} />}
{isSubscribed && (
<BillingPortalButton
workspaceId={workspace.id}
colorScheme={
data?.subscription?.status === 'past_due' ? 'blue' : undefined
}
/>
)}
</Stack>
)
}