From fae97b71b9619fdaded9b743129af3259d4e6f1f Mon Sep 17 00:00:00 2001 From: bender Date: Wed, 11 Mar 2026 19:39:09 +0000 Subject: [PATCH] Update src/components/cardStack/CardStackTextBox.tsx --- src/components/cardStack/CardStackTextBox.tsx | 99 +++---------------- 1 file changed, 11 insertions(+), 88 deletions(-) diff --git a/src/components/cardStack/CardStackTextBox.tsx b/src/components/cardStack/CardStackTextBox.tsx index 124a4c7..2fd3c93 100644 --- a/src/components/cardStack/CardStackTextBox.tsx +++ b/src/components/cardStack/CardStackTextBox.tsx @@ -1,92 +1,15 @@ -"use client"; +'use client'; -import { memo, useMemo } from "react"; -import TextBox from "@/components/Textbox"; -import { cls } from "@/lib/utils"; -import type { TextBoxProps } from "./types"; +import React from 'react'; +import { TextBoxProps } from '@/components/cardStack/types'; -const CardStackTextBox = ({ - title, - titleSegments, - description, - tag, - tagIcon, - tagAnimation, - buttons, - buttonAnimation, - textboxLayout, - useInvertedBackground, - textBoxClassName = "", - titleClassName = "", - titleImageWrapperClassName = "", - titleImageClassName = "", - descriptionClassName = "", - tagClassName = "", - buttonContainerClassName = "", - buttonClassName = "", - buttonTextClassName = "", -}: TextBoxProps) => { - const styles = useMemo(() => { - if (textboxLayout === "default") { - return { - className: cls("flex flex-col gap-3 md:gap-2", textBoxClassName), - titleClassName: cls("text-6xl font-medium text-center", titleClassName), - descriptionClassName: cls("text-lg leading-tight text-center md:max-w-6/10", descriptionClassName), - tagClassName: cls("w-fit px-3 py-1 text-sm rounded-theme card text-foreground inline-flex items-center gap-2 mb-0 mx-auto", tagClassName), - buttonContainerClassName: cls("flex flex-wrap gap-4 max-md:justify-center mt-1 md:mt-3 justify-center", buttonContainerClassName), - center: true, - }; - } - - if (textboxLayout === "inline-image") { - return { - className: cls("flex flex-col gap-3 md:gap-2", textBoxClassName), - titleClassName: cls("text-4xl md:text-5xl font-medium text-center", titleClassName), - descriptionClassName: cls("text-lg leading-tight text-center", descriptionClassName), - tagClassName: cls("w-fit px-3 py-1 text-sm rounded-theme card text-foreground inline-flex items-center gap-2 mb-0 mx-auto", tagClassName), - buttonContainerClassName: cls("flex flex-wrap gap-4 max-md:justify-center mt-1 md:mt-3 justify-center", buttonContainerClassName), - center: true, - }; - } - - return { - className: textBoxClassName, - titleClassName: cls("text-6xl font-medium", titleClassName), - descriptionClassName: cls("text-lg leading-tight", descriptionClassName), - tagClassName: cls("px-3 py-1 text-sm rounded-theme card text-foreground inline-flex items-center gap-2", tagClassName), - buttonContainerClassName: cls("flex flex-wrap gap-4 max-md:justify-center", buttonContainerClassName), - center: false, - }; - }, [textboxLayout, textBoxClassName, titleClassName, descriptionClassName, tagClassName, buttonContainerClassName]); - - if (!title && !titleSegments && !description) return null; - - return ( - - ); +const CardStackTextBox: React.FC = ({ title, description, className = '' }) => { + return ( +
+

{title}

+

{description}

+
+ ); }; -CardStackTextBox.displayName = "CardStackTextBox"; - -export default memo(CardStackTextBox); +export default CardStackTextBox;