diff --git a/src/components/ui/Timeline.jsx b/src/components/ui/Timeline.jsx new file mode 100644 index 0000000..7dcda3d --- /dev/null +++ b/src/components/ui/Timeline.jsx @@ -0,0 +1,180 @@ +export function Timeline({ children, className = "" }) { + return ( +
+
+ {/* Desktop Line */} +
+ {children} +
+ ); +} + +export function TimelineItem({ + title, + date, + status = "upcoming", // "completed", "active", "upcoming" + icon, + children, + rightContent, + className = "", +}) { + const statusConfig = { + completed: { + dotClass: "border-2 border-primary-fixed bg-surface", + iconColor: "text-primary-fixed", + titleClass: "text-on-surface", + dateClass: "text-on-surface-variant", + contentClass: "text-on-surface-variant", + iconNode: ( + + ), + }, + active: { + dotClass: "bg-primary-fixed shadow-[0_0_30px_rgba(243,230,75,0.4)]", + iconColor: "text-on-primary-fixed", + titleClass: "text-on-surface", + dateClass: "text-primary-fixed", + contentClass: "text-on-surface", + iconNode: ( + + ), + }, + upcoming: { + dotClass: "border-2 border-surface-container-high bg-surface", + iconColor: "text-on-surface-variant", + titleClass: "text-on-surface-variant/70", + dateClass: "text-on-surface-variant/50", + contentClass: "text-on-surface-variant/50", + iconNode: + title?.toLowerCase().includes("phase 4") || + title?.toLowerCase().includes("shortlisted") ? ( + + ) : ( + + ), + }, + }; + + const config = statusConfig[status] || statusConfig.upcoming; + + return ( +
+ {/* Center Dot (Desktop) */} +
+ {icon ? icon : config.iconNode} +
+ + {/* Center Dot (Mobile) */} +
+ {icon ? icon : config.iconNode} +
+ + {/* Left Side Container (Title & Date on Desktop, everything on Mobile) */} +
+ {date && ( +
+ {date} + {status === "active" && ( + • CURRENT PHASE + )} +
+ )} +

+ {title} +

+ + {/* On mobile, we render children here if there's no rightContent, or both. */} +
+ {rightContent ? ( + <> + {children} +
{rightContent}
+ + ) : ( + children + )} +
+ + {/* On Desktop, if rightContent exists, children goes on the left */} + {rightContent && ( +
+ {children} +
+ )} +
+ + {/* Right Side Container (Desktop only, or hidden on mobile) */} +
+ {rightContent ? ( + rightContent + ) : ( +
+ {children} +
+ )} +
+
+ ); +} + +Timeline.Item = TimelineItem; +export default Timeline;