From 21b46532b6a081fe5bd5c3737ba5d6a90dfb3d8c Mon Sep 17 00:00:00 2001 From: development Date: Fri, 23 Jan 2026 17:23:57 +0000 Subject: [PATCH] Update src/components/sections/pricing/PricingCardEight.tsx --- .../sections/pricing/PricingCardEight.tsx | 314 +++++------------- 1 file changed, 85 insertions(+), 229 deletions(-) diff --git a/src/components/sections/pricing/PricingCardEight.tsx b/src/components/sections/pricing/PricingCardEight.tsx index 8917e13..3f9b73c 100644 --- a/src/components/sections/pricing/PricingCardEight.tsx +++ b/src/components/sections/pricing/PricingCardEight.tsx @@ -1,242 +1,98 @@ -"use client"; +import React from 'react'; +import { Check } from 'lucide-react'; -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 } from "@/components/cardStack/types"; -import type { TextboxLayout, InvertedBackground } from "@/providers/themeProvider/config/constants"; +interface PricingFeature { + text: string; + included: boolean; +} -type PricingPlan = { - id: string; - badge: string; - badgeIcon?: LucideIcon; - price: string; - subtitle: string; - buttons: ButtonConfig[]; - features: string[]; -}; +interface PricingPlan { + id: string; + name: string; + price: number; + period: string; + description: string; + features: PricingFeature[]; + popular?: boolean; + buttonText: string; +} interface PricingCardEightProps { - plans: PricingPlan[]; - carouselMode?: "auto" | "buttons"; - uniformGridCustomHeightClasses?: string; - animationType: CardAnimationType; - title: string; - titleSegments?: TitleSegment[]; - description: string; - tag?: string; - tagIcon?: LucideIcon; - buttons?: ButtonConfig[]; - 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; + plan: PricingPlan; + className?: string; + onSelect?: (planId: string) => void; } -interface PricingCardItemProps { - plan: PricingPlan; - shouldUseLightText: boolean; - cardClassName?: string; - badgeClassName?: string; - priceClassName?: string; - subtitleClassName?: string; - planButtonContainerClassName?: string; - planButtonClassName?: string; - featuresClassName?: string; - featureItemClassName?: string; -} +export const PricingCardEight: React.FC = ({ + plan, + className = '', + onSelect +}) => { + const handleSelect = () => { + if (onSelect) { + onSelect(plan.id); + } + }; -const PricingCardItem = memo(({ - plan, - shouldUseLightText, - cardClassName = "", - badgeClassName = "", - priceClassName = "", - subtitleClassName = "", - planButtonContainerClassName = "", - planButtonClassName = "", - featuresClassName = "", - featureItemClassName = "", -}: PricingCardItemProps) => { - const theme = useTheme(); + const cardClasses = [ + 'relative bg-white rounded-2xl shadow-lg border border-gray-200 p-8', + 'hover:shadow-xl transition-all duration-300', + plan.popular ? 'ring-2 ring-blue-500 scale-105' : '', + className + ].filter(Boolean).join(' '); - const getButtonConfigProps = () => { - if (theme.defaultButtonVariant === "hover-bubble") { - return { bgClassName: "w-full" }; - } - if (theme.defaultButtonVariant === "icon-arrow") { - return { className: "justify-between" }; - } - return {}; - }; + const buttonClasses = [ + 'w-full py-3 px-6 rounded-lg font-semibold transition-colors duration-200', + plan.popular + ? 'bg-blue-600 text-white hover:bg-blue-700' + : 'bg-gray-100 text-gray-900 hover:bg-gray-200 border border-gray-300' + ].join(' '); - return ( -
-
- - -
-
- {plan.price} -
- -

- {plan.subtitle} -

-
- - {plan.buttons && plan.buttons.length > 0 && ( -
- {plan.buttons.slice(0, 2).map((button, index) => ( -
- )} -
- -
- -
+ return ( +
+ {plan.popular && ( +
+ + Most Popular +
- ); -}); + )} -PricingCardItem.displayName = "PricingCardItem"; +
+

{plan.name}

+

{plan.description}

+ +
+ ${plan.price} + /{plan.period} +
+
-const PricingCardEight = ({ - plans, - carouselMode = "buttons", - uniformGridCustomHeightClasses, - animationType, - title, - titleSegments, - description, - tag, - tagIcon, - buttons, - 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); +
+ {plan.features.map((feature, index) => ( +
+
+ +
+ + {feature.text} + +
+ ))} +
- return ( - - {plans.map((plan, index) => ( - - ))} - - ); -}; - -PricingCardEight.displayName = "PricingCardEight"; - -export default PricingCardEight; + +
+ ); +}; \ No newline at end of file