"use client"; import { useState } from "react"; import { cls, shouldUseInvertedText } from "@/lib/utils"; import { ArrowRight } from "lucide-react"; import Tag from "@/components/shared/Tag"; import SelectorButton from "@/components/button/SelectorButton"; import AnimationContainer from "@/components/sections/AnimationContainer"; import { useCardAnimation } from "@/components/cardStack/hooks/useCardAnimation"; import { useTheme } from "@/providers/themeProvider/ThemeProvider"; import type { LucideIcon } from "lucide-react"; import type { InvertedBackground } from "@/providers/themeProvider/config/constants"; import type { CardAnimationType } from "@/components/cardStack/types"; interface CtaCard { title: string; description: string; href?: string; onClick?: () => void; } interface PricingPlan { id: string; name: string; price: string; subtitle: string; features: string[]; } interface PricingCardFourProps { title: string; tag: string; tagIcon?: LucideIcon; ctaCards: [CtaCard, CtaCard]; plans: PricingPlan[]; useInvertedBackground: InvertedBackground; animationType: CardAnimationType; featuresElevate Your Brand with Expert Copywriting and Content Enhancement?: string; ariaLabel?: string; className?: string; containerClassName?: string; leftPanelClassName?: string; rightPanelClassName?: string; tagClassName?: string; titleClassName?: string; ctaCardClassName?: string; ctaCardElevate Your Brand with Expert Copywriting and Content EnhancementClassName?: string; ctaCardDescriptionClassName?: string; planSelectorClassName?: string; priceClassName?: string; subtitleClassName?: string; featuresElevate Your Brand with Expert Copywriting and Content EnhancementClassName?: string; featuresGridClassName?: string; featureItemClassName?: string; } const PricingCardFour = ({ title, tag, tagIcon: TagIcon, ctaCards, plans, useInvertedBackground, animationType, featuresElevate Your Brand with Expert Copywriting and Content Enhancement = "What's included", ariaLabel = "Pricing section", className = "", containerClassName = "", leftPanelClassName = "", rightPanelClassName = "", tagClassName = "", titleClassName = "", ctaCardClassName = "", ctaCardElevate Your Brand with Expert Copywriting and Content EnhancementClassName = "", ctaCardDescriptionClassName = "", planSelectorClassName = "", priceClassName = "", subtitleClassName = "", featuresElevate Your Brand with Expert Copywriting and Content EnhancementClassName = "", featuresGridClassName = "", featureItemClassName = "", }: PricingCardFourProps) => { const [activePlanIndex, setActivePlanIndex] = useState(0); const activePlan = plans[activePlanIndex]; const theme = useTheme(); const shouldUseLightText = shouldUseInvertedText(useInvertedBackground, theme.cardStyle); const { itemRefs } = useCardAnimation({ animationType, itemCount: 2 }); const handleCtaClick = (ctaCard: CtaCard) => { if (ctaCard.onClick) { ctaCard.onClick(); } if (ctaCard.href) { window.location.href = ctaCard.href; } }; return (
{ itemRefs.current[0] = el; }} className={cls( "md:col-span-5 card rounded-theme-capped p-6 md:p-8 flex flex-col gap-4", leftPanelClassName )} >

{title}

{ctaCards.map((ctaCard, index) => ( ))}
{ itemRefs.current[1] = el; }} className={cls( "md:col-span-7 card rounded-theme-capped p-6 md:p-8 flex flex-col gap-4", rightPanelClassName )} > ({ value: plan.id, label: plan.name, }))} activeValue={activePlan.id} onValueChange={(value) => { const index = plans.findIndex((p) => p.id === value); if (index !== -1) setActivePlanIndex(index); }} wrapperClassName={planSelectorClassName} />

{activePlan.price}

{activePlan.subtitle}

{featuresElevate Your Brand with Expert Copywriting and Content Enhancement}

{activePlan.features.map((feature, index) => (
{feature}
))}
); }; PricingCardFour.displayName = "PricingCardFour"; export default PricingCardFour;