From 1baff37079d5e6a14800befe1f21f9865d28bcb7 Mon Sep 17 00:00:00 2001 From: "Builder.io" Date: Sat, 15 Nov 2025 09:28:23 +0000 Subject: [PATCH] Create MentorshipWidget for FOUNDATION dashboard cgen-154f6c398df8421ea67748913fa2662f --- client/components/MentorshipWidget.tsx | 240 +++++++++++++++++++++++++ 1 file changed, 240 insertions(+) create mode 100644 client/components/MentorshipWidget.tsx diff --git a/client/components/MentorshipWidget.tsx b/client/components/MentorshipWidget.tsx new file mode 100644 index 00000000..f4bb47a5 --- /dev/null +++ b/client/components/MentorshipWidget.tsx @@ -0,0 +1,240 @@ +import { Card, CardContent, CardDescription, CardHeader, CardTitle } from "@/components/ui/card"; +import { Badge } from "@/components/ui/badge"; +import { Button } from "@/components/ui/button"; +import { Users, Calendar, CheckCircle, Clock, MessageCircle, ArrowRight } from "lucide-react"; + +export interface Mentor { + id: string; + name: string; + title?: string; + bio?: string; + avatar_url?: string; + specialties?: string[]; +} + +export interface MentorshipStatus { + id: string; + type: "mentee" | "mentor"; + status: "active" | "paused" | "completed"; + mentee?: Mentor; + mentor?: Mentor; + start_date?: string; + end_date?: string; + sessions_completed?: number; + next_session?: string; +} + +interface MentorshipWidgetProps { + mentorship: MentorshipStatus | null; + title?: string; + description?: string; + onRequestMentor?: () => void; + onScheduleSession?: () => void; + onViewProfile?: () => void; + accentColor?: "red" | "blue" | "purple"; +} + +const colorMap = { + red: { + bg: "bg-gradient-to-br from-red-950/40 to-red-900/20", + border: "border-red-500/20", + }, + blue: { + bg: "bg-gradient-to-br from-blue-950/40 to-blue-900/20", + border: "border-blue-500/20", + }, + purple: { + bg: "bg-gradient-to-br from-purple-950/40 to-purple-900/20", + border: "border-purple-500/20", + }, +}; + +export function MentorshipWidget({ + mentorship, + title = "My Mentorship", + description = "Connect with experienced mentors", + onRequestMentor, + onScheduleSession, + onViewProfile, + accentColor = "red", +}: MentorshipWidgetProps) { + const colors = colorMap[accentColor]; + const person = mentorship?.type === "mentor" ? mentorship.mentor : mentorship?.mentee; + + if (!mentorship) { + return ( + + + + + {title} + + {description} + + +
+ +
+

No active mentorship

+

+ {title.includes("Mentorship") + ? "Connect with an experienced mentor or become one yourself" + : ""} +

+
+ {onRequestMentor && ( + + )} +
+
+
+ ); + } + + return ( + + + + + {title} + + + {mentorship.type === "mentor" ? "Mentoring someone" : "Being mentored by"} + + + + {/* Status Badge */} +
+ + {mentorship.status === "active" ? "🟢" : "⏸"} + {" "}{mentorship.status.charAt(0).toUpperCase() + mentorship.status.slice(1)} + +
+ + {/* Person Card */} + {person && ( +
+ {/* Profile */} +
+ {person.avatar_url && ( + {person.name} + )} +
+

{person.name}

+ {person.title && ( +

{person.title}

+ )} + {person.bio && ( +

{person.bio}

+ )} +
+
+ + {/* Specialties */} + {person.specialties && person.specialties.length > 0 && ( +
+

Specialties

+
+ {person.specialties.slice(0, 4).map((specialty) => ( + + {specialty} + + ))} + {person.specialties.length > 4 && ( + + +{person.specialties.length - 4} + + )} +
+
+ )} +
+ )} + + {/* Session Info */} +
+ {mentorship.sessions_completed !== undefined && ( +
+

Sessions

+

{mentorship.sessions_completed}

+
+ )} + {mentorship.next_session && ( +
+

Next Session

+

+ {new Date(mentorship.next_session).toLocaleDateString()} +

+
+ )} + {mentorship.start_date && ( +
+

Started

+

+ {new Date(mentorship.start_date).toLocaleDateString()} +

+
+ )} + {mentorship.end_date && ( +
+

Ends

+

+ {new Date(mentorship.end_date).toLocaleDateString()} +

+
+ )} +
+ + {/* Actions */} +
+ {onScheduleSession && ( + + )} + {onViewProfile && ( + + )} + +
+
+
+ ); +} + +export default MentorshipWidget;