diff --git a/src/components/sections/feature/FeatureCardSixteen.tsx b/src/components/sections/feature/FeatureCardSixteen.tsx index 9ffef8b..3524255 100644 --- a/src/components/sections/feature/FeatureCardSixteen.tsx +++ b/src/components/sections/feature/FeatureCardSixteen.tsx @@ -1,31 +1,167 @@ -import React, { useContext } from 'react'; -import { CardStackContext } from '@/components/cardStack/CardStackContext'; +"use client"; -interface FeatureCardSixteenProps { - features: Array<{ - id: string; - title: string; - description: string; - }>; - title: string; - [key: string]: any; -} +import CardStackTextBox from "@/components/cardStack/CardStackTextBox"; +import PricingFeatureList from "@/components/shared/PricingFeatureList"; +import { useCardAnimation } from "@/components/cardStack/hooks/useCardAnimation"; +import { Check, X } from "lucide-react"; +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"; -const FeatureCardSixteen: React.FC = ({ features, title, ...props }) => { - const context = useContext(CardStackContext); - const animationProps = context ? context.getAnimationProps() : {}; - - return ( -
-

{title}

- {features.map((feature) => ( -
-

{feature.title}

-

{feature.description}

-
- ))} -
- ); +type ComparisonItem = { + items: string[]; }; +interface FeatureCardSixteenProps { + negativeCard: ComparisonItem; + positiveCard: ComparisonItem; + animationType: CardAnimationTypeWith3D; + title: string; + titleSegments?: TitleSegment[]; + description: string; + textboxLayout: TextboxLayout; + useInvertedBackground: InvertedBackground; + tag?: string; + tagIcon?: LucideIcon; + tagAnimation?: ButtonAnimationType; + buttons?: ButtonConfig[]; + buttonAnimation?: ButtonAnimationType; + ariaLabel?: string; + className?: string; + containerClassName?: string; + textBoxTitleClassName?: string; + titleImageWrapperClassName?: string; + titleImageClassName?: string; + textBoxDescriptionClassName?: string; + textBoxClassName?: string; + textBoxTagClassName?: string; + textBoxButtonContainerClassName?: string; + textBoxButtonClassName?: string; + textBoxButtonTextClassName?: string; + gridClassName?: string; + cardClassName?: string; + itemsListClassName?: string; + itemClassName?: string; + itemIconClassName?: string; + itemTextClassName?: string; +} + +const FeatureCardSixteen = ({ + negativeCard, + positiveCard, + animationType, + title, + titleSegments, + description, + textboxLayout, + useInvertedBackground, + tag, + tagIcon, + tagAnimation, + buttons, + buttonAnimation, + ariaLabel = "Feature comparison section", + className = "", + containerClassName = "", + textBoxTitleClassName = "", + titleImageWrapperClassName = "", + titleImageClassName = "", + textBoxDescriptionClassName = "", + textBoxClassName = "", + textBoxTagClassName = "", + textBoxButtonContainerClassName = "", + textBoxButtonClassName = "", + textBoxButtonTextClassName = "", + gridClassName = "", + cardClassName = "", + itemsListClassName = "", + itemClassName = "", + itemIconClassName = "", + itemTextClassName = "", +}: FeatureCardSixteenProps) => { + const theme = useTheme(); + const shouldUseLightText = shouldUseInvertedText(useInvertedBackground, theme.cardStyle); + const { itemRefs, containerRef, perspectiveRef } = useCardAnimation({ + animationType, + itemCount: 2, + isGrid: true, + supports3DAnimation: true, + gridVariant: "uniform-all-items-equal" + }); + + const cards = [ + { ...negativeCard, variant: "negative" as const }, + { ...positiveCard, variant: "positive" as const }, + ]; + + return ( +
+
+ + +
= 2 ? "md:grid-cols-2" : "md:grid-cols-1", + gridClassName + )} + > + {cards.map((card, index) => ( +
{ itemRefs.current[index] = el; }} + className={cls( + "relative h-full card rounded-theme-capped p-6", + cardClassName + )} + > +
+ +
+
+ ))} +
+
+
+ ); +}; + +FeatureCardSixteen.displayName = "FeatureCardSixteen"; + export default FeatureCardSixteen; \ No newline at end of file