From d43927ce2914bb0978f1616ea2fc0d2d0c5dadfa Mon Sep 17 00:00:00 2001 From: bender Date: Wed, 11 Mar 2026 19:53:54 +0000 Subject: [PATCH] Update src/components/sections/pricing/PricingCardEight.tsx --- .../sections/pricing/PricingCardEight.tsx | 291 ++++-------------- 1 file changed, 58 insertions(+), 233 deletions(-) diff --git a/src/components/sections/pricing/PricingCardEight.tsx b/src/components/sections/pricing/PricingCardEight.tsx index 5c00d72..02a57c9 100644 --- a/src/components/sections/pricing/PricingCardEight.tsx +++ b/src/components/sections/pricing/PricingCardEight.tsx @@ -1,248 +1,73 @@ "use client"; -import { memo } from "react"; -import CardStack from "@/components/cardStack/CardStack"; -import Button from "@/components/button/Button"; -import PricingBadge from "@/components/shared/PricingBadge"; -import PricingFeatureList from "@/components/shared/PricingFeatureList"; -import { getButtonProps } from "@/lib/buttonUtils"; -import { cls, shouldUseInvertedText } from "@/lib/utils"; -import { useTheme } from "@/providers/themeProvider/ThemeProvider"; -import type { LucideIcon } from "lucide-react"; -import type { ButtonConfig, CardAnimationType, TitleSegment, ButtonAnimationType } from "@/components/cardStack/types"; -import type { TextboxLayout, InvertedBackground } from "@/providers/themeProvider/config/constants"; - -type PricingPlan = { - id: string; - badge: string; - badgeIcon?: LucideIcon; - price: string; - subtitle: string; - buttons: ButtonConfig[]; - features: string[]; -}; +import React from 'react'; interface PricingCardEightProps { - plans: PricingPlan[]; - carouselMode?: "auto" | "buttons"; - uniformGridCustomHeightClasses?: string; - animationType: CardAnimationType; - title: string; - titleSegments?: TitleSegment[]; - description: string; - tag?: string; - tagIcon?: LucideIcon; - tagAnimation?: ButtonAnimationType; - buttons?: ButtonConfig[]; - buttonAnimation?: ButtonAnimationType; - textboxLayout: TextboxLayout; - useInvertedBackground: InvertedBackground; - ariaLabel?: string; - className?: string; - containerClassName?: string; - cardClassName?: string; - textBoxTitleClassName?: string; - textBoxTitleImageWrapperClassName?: string; - textBoxTitleImageClassName?: string; - textBoxDescriptionClassName?: string; - badgeClassName?: string; - priceClassName?: string; - subtitleClassName?: string; - planButtonContainerClassName?: string; - planButtonClassName?: string; - featuresClassName?: string; - featureItemClassName?: string; - gridClassName?: string; - carouselClassName?: string; - controlsClassName?: string; - textBoxClassName?: string; - textBoxTagClassName?: string; - textBoxButtonContainerClassName?: string; - textBoxButtonClassName?: string; - textBoxButtonTextClassName?: string; + plans: Array<{ + id: string; + badge: string; + badgeIcon?: React.ComponentType; + price: string; + subtitle: string; + buttons: Array<{ text: string; onClick?: () => void; href?: string }>; + features: string[]; + }>; + animationType?: string; + title?: string; + description?: string; + textboxLayout?: string; + useInvertedBackground?: boolean; } -interface PricingCardItemProps { - plan: PricingPlan; - shouldUseLightText: boolean; - cardClassName?: string; - badgeClassName?: string; - priceClassName?: string; - subtitleClassName?: string; - planButtonContainerClassName?: string; - planButtonClassName?: string; - featuresClassName?: string; - featureItemClassName?: string; -} +const PricingCardEight: React.FC = ({ + plans, + title, + description, + useInvertedBackground = false, +}) => { + return ( +
+
+ {title &&

{title}

} + {description &&

{description}

} -const PricingCardItem = memo(({ - plan, - shouldUseLightText, - cardClassName = "", - badgeClassName = "", - priceClassName = "", - subtitleClassName = "", - planButtonContainerClassName = "", - planButtonClassName = "", - featuresClassName = "", - featureItemClassName = "", -}: PricingCardItemProps) => { - const theme = useTheme(); +
+ {plans.map((plan) => ( +
+
+ {plan.badgeIcon && } + {plan.badge} +
- const getButtonConfigProps = () => { - if (theme.defaultButtonVariant === "hover-bubble") { - return { bgClassName: "w-full" }; - } - if (theme.defaultButtonVariant === "icon-arrow") { - return { className: "justify-between" }; - } - return {}; - }; +

{plan.price}

+

{plan.subtitle}

- return ( -
-
- +
+ {plan.buttons.map((btn, idx) => ( + + ))} +
-
-
- {plan.price} -
- -

- {plan.subtitle} -

-
- - {plan.buttons && plan.buttons.length > 0 && ( -
- {plan.buttons.slice(0, 2).map((button, index) => ( -
- )} -
- -
- +
    + {plan.features.map((feature, idx) => ( +
  • + + {feature} +
  • + ))} +
+ ))}
- ); -}); - -PricingCardItem.displayName = "PricingCardItem"; - -const PricingCardEight = ({ - plans, - carouselMode = "buttons", - uniformGridCustomHeightClasses, - animationType, - title, - titleSegments, - description, - tag, - tagIcon, - tagAnimation, - buttons, - buttonAnimation, - textboxLayout, - useInvertedBackground, - ariaLabel = "Pricing section", - className = "", - containerClassName = "", - cardClassName = "", - textBoxTitleClassName = "", - textBoxTitleImageWrapperClassName = "", - textBoxTitleImageClassName = "", - textBoxDescriptionClassName = "", - badgeClassName = "", - priceClassName = "", - subtitleClassName = "", - planButtonContainerClassName = "", - planButtonClassName = "", - featuresClassName = "", - featureItemClassName = "", - gridClassName = "", - carouselClassName = "", - controlsClassName = "", - textBoxClassName = "", - textBoxTagClassName = "", - textBoxButtonContainerClassName = "", - textBoxButtonClassName = "", - textBoxButtonTextClassName = "", -}: PricingCardEightProps) => { - const theme = useTheme(); - const shouldUseLightText = shouldUseInvertedText(useInvertedBackground, theme.cardStyle); - - return ( - - {plans.map((plan, index) => ( - - ))} - - ); +
+
+ ); }; -PricingCardEight.displayName = "PricingCardEight"; - export default PricingCardEight;