From ea2c4606bd17c19f6d7413349d2f6a93ea2f8e42 Mon Sep 17 00:00:00 2001 From: bender Date: Mon, 9 Mar 2026 08:26:46 +0000 Subject: [PATCH] Switch to version 1: modified src/components/sections/pricing/PricingCardOne.tsx --- .../sections/pricing/PricingCardOne.tsx | 224 ++++++++++++++++-- 1 file changed, 201 insertions(+), 23 deletions(-) diff --git a/src/components/sections/pricing/PricingCardOne.tsx b/src/components/sections/pricing/PricingCardOne.tsx index f4c05e1..d1d12f0 100644 --- a/src/components/sections/pricing/PricingCardOne.tsx +++ b/src/components/sections/pricing/PricingCardOne.tsx @@ -1,28 +1,206 @@ -import React from "react"; -import { CardStack } from "@/components/cardStack/CardStack"; +"use client"; + +import { memo } from "react"; +import CardStack from "@/components/cardStack/CardStack"; +import PricingBadge from "@/components/shared/PricingBadge"; +import PricingFeatureList from "@/components/shared/PricingFeatureList"; +import { cls, shouldUseInvertedText } from "@/lib/utils"; +import { useTheme } from "@/providers/themeProvider/ThemeProvider"; +import type { LucideIcon } from "lucide-react"; +import type { ButtonConfig, CardAnimationTypeWith3D, 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; + features: string[]; +}; interface PricingCardOneProps { - plans?: any[]; - title?: string; - description?: string; - animationType?: string; - textboxLayout?: string; - useInvertedBackground?: boolean; + plans: PricingPlan[]; + carouselMode?: "auto" | "buttons"; + uniformGridCustomHeightClasses?: string; + animationType: CardAnimationTypeWith3D; + 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; + featuresClassName?: string; + featureItemClassName?: string; + gridClassName?: string; + carouselClassName?: string; + controlsClassName?: string; + textBoxClassName?: string; + textBoxTagClassName?: string; + textBoxButtonContainerClassName?: string; + textBoxButtonClassName?: string; + textBoxButtonTextClassName?: string; } -export default function PricingCardOne({ - plans = [], - title = "Pricing", description = "Our plans", animationType = "slide-up", textboxLayout = "default", useInvertedBackground = false, -}: PricingCardOneProps) { - const items = plans.map((plan) => ({ - id: plan.id, - label: plan.price, - detail: plan.subtitle, - })); - - return ( -
- -
- ); +interface PricingCardItemProps { + plan: PricingPlan; + shouldUseLightText: boolean; + cardClassName?: string; + badgeClassName?: string; + priceClassName?: string; + subtitleClassName?: string; + featuresClassName?: string; + featureItemClassName?: string; } + +const PricingCardItem = memo(({ + plan, + shouldUseLightText, + cardClassName = "", + badgeClassName = "", + priceClassName = "", + subtitleClassName = "", + featuresClassName = "", + featureItemClassName = "", +}: PricingCardItemProps) => { + return ( +
+ + +
+
+ {plan.price} +
+ +

+ {plan.subtitle} +

+
+ +
+ + +
+ ); +}); + +PricingCardItem.displayName = "PricingCardItem"; + +const PricingCardOne = ({ + 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 = "", + featuresClassName = "", + featureItemClassName = "", + gridClassName = "", + carouselClassName = "", + controlsClassName = "", + textBoxClassName = "", + textBoxTagClassName = "", + textBoxButtonContainerClassName = "", + textBoxButtonClassName = "", + textBoxButtonTextClassName = "", +}: PricingCardOneProps) => { + const theme = useTheme(); + const shouldUseLightText = shouldUseInvertedText(useInvertedBackground, theme.cardStyle); + + return ( + + {plans.map((plan, index) => ( + + ))} + + ); +}; + +PricingCardOne.displayName = "PricingCardOne"; + +export default PricingCardOne;