import { Flex, Heading, List, ListIcon, ListItem, Text, useColorModeValue, VStack, } from '@chakra-ui/react' import * as React from 'react' import { CheckCircleIcon } from '../../../assets/icons/CheckCircleIcon' import { Card, CardProps } from './Card' import { formatPrice } from '@typebot.io/billing/helpers/formatPrice' export interface PricingCardData { features: React.ReactNode[] name: string price: number | string featureLabel?: string } interface PricingCardProps extends CardProps { data: PricingCardData icon?: JSX.Element button: React.ReactElement } export const PricingCard = ({ data, icon, button, ...rest }: PricingCardProps) => { const { features, price, name } = data const accentColor = useColorModeValue('blue.500', 'white') const formattedPrice = typeof price === 'number' ? formatPrice(price) : price return ( {icon} {name} {formattedPrice} {typeof price === 'number' && ( / month )} {data.featureLabel && ( {data.featureLabel} )} {features.map((feature, index) => ( {feature} ))} {button} ) }