Auto continue bot on whatsApp if starting block is input (#849)

<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
### Summary by CodeRabbit

**New Features:**
- Added WhatsApp integration feature to the Pro plan.

**Refactor:**
- Introduced the ability to exclude specific plans from being displayed
in the Change Plan Modal.
- Renamed the function `isProPlan` to `hasProPerks`, enhancing code
readability and maintainability.
- Updated the `EmbedButton` component to handle a new `lockTagPlan`
property and use the `modal` function instead of the `Modal` component.

**Chore:**
- Removed the `whatsAppPhoneNumberId` field from the `Typebot` model
across various files, simplifying the data structure of the model.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
This commit is contained in:
Baptiste Arnaud
2023-09-25 17:20:42 +02:00
committed by GitHub
parent 459fc4debc
commit b81fcf0167
30 changed files with 224 additions and 140 deletions

View File

@@ -13,9 +13,10 @@ import {
} from '@chakra-ui/react'
import { ChangePlanForm } from './ChangePlanForm'
type ChangePlanModalProps = {
export type ChangePlanModalProps = {
type?: string
isOpen: boolean
excludedPlans?: ('STARTER' | 'PRO')[]
onClose: () => void
}
@@ -23,11 +24,16 @@ export const ChangePlanModal = ({
onClose,
isOpen,
type,
excludedPlans,
}: ChangePlanModalProps) => {
const t = useI18n()
const { workspace } = useWorkspace()
return (
<Modal isOpen={isOpen} onClose={onClose} size="2xl">
<Modal
isOpen={isOpen}
onClose={onClose}
size={excludedPlans ? 'lg' : '2xl'}
>
<ModalOverlay />
<ModalContent>
<ModalBody as={Stack} spacing="6" pt="10">
@@ -36,7 +42,12 @@ export const ChangePlanModal = ({
{t('billing.upgradeLimitLabel', { type: type })}
</AlertInfo>
)}
{workspace && <ChangePlanForm workspace={workspace} />}
{workspace && (
<ChangePlanForm
workspace={workspace}
excludedPlans={excludedPlans}
/>
)}
</ModalBody>
<ModalFooter>