From 055b80b5e8624298f45b2ae27f9386b230897997 Mon Sep 17 00:00:00 2001 From: bender Date: Tue, 3 Mar 2026 04:58:47 +0000 Subject: [PATCH] Update src/components/cardStack/layouts/timelines/TimelineBase.tsx --- .../layouts/timelines/TimelineBase.tsx | 74 +++++++++---------- 1 file changed, 37 insertions(+), 37 deletions(-) diff --git a/src/components/cardStack/layouts/timelines/TimelineBase.tsx b/src/components/cardStack/layouts/timelines/TimelineBase.tsx index d9405a1..0873f54 100644 --- a/src/components/cardStack/layouts/timelines/TimelineBase.tsx +++ b/src/components/cardStack/layouts/timelines/TimelineBase.tsx @@ -1,44 +1,44 @@ -import React, { useMemo } from "react"; -import { CardStack, CardStackProps } from "@/components/cardStack"; -import { cn } from "@/lib/utils"; +import React from "react"; +import { TimelineItem } from "../types"; -export interface TimelineItem { - id: string; - reverse?: boolean; - media?: React.ReactNode; - content?: React.ReactNode; -} - -export interface TimelineBaseProps extends Omit { +export interface TimelineBaseProps { items: TimelineItem[]; - animationType?: "slide-up" | "none" | "opacity" | "blur-reveal"; + title?: string; + description?: string; + tag?: string; + animationType?: string; + textboxLayout?: string; + className?: string; + containerClassName?: string; + children?: React.ReactNode; } -export const TimelineBase: React.FC = ({ - items, - animationType = "slide-up", className, - containerClassName, - ...props -}) => { - const timelineItems = useMemo( - () => - items.map((item) => ({ - id: item.id, - title: "", description: "", content: item.content, - media: item.media, - reverse: item.reverse - })), - [items] - ); +const TimelineBase = React.forwardRef( + ( + { + items, + title, + description, + tag, + animationType = "none", textboxLayout = "default", className = "", containerClassName = "", children, + }, + ref + ) => { + return ( +
+ {tag &&
{tag}
} + {title &&

{title}

} + {description && ( +

{description}

+ )} +
+ {children} +
+
+ ); + } +); - return ( - - ); -}; +TimelineBase.displayName = "TimelineBase"; export default TimelineBase;