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;