diff --git a/client/pages/creators/CreatorProfile.tsx b/client/pages/creators/CreatorProfile.tsx new file mode 100644 index 00000000..fc3fe9b1 --- /dev/null +++ b/client/pages/creators/CreatorProfile.tsx @@ -0,0 +1,244 @@ +import { useState, useEffect } from "react"; +import { useParams, useNavigate } from "react-router-dom"; +import Layout from "@/components/Layout"; +import { Button } from "@/components/ui/button"; +import { Card, CardContent, CardHeader, CardTitle } from "@/components/ui/card"; +import { Avatar, AvatarImage, AvatarFallback } from "@/components/ui/avatar"; +import { Badge } from "@/components/ui/badge"; +import { Loader2, ArrowLeft, ExternalLink, MessageSquare } from "lucide-react"; +import { getCreatorByUsername } from "@/api/creators"; +import { ArmBadge } from "@/components/creator-network/ArmBadge"; +import type { Creator } from "@/api/creators"; + +export default function CreatorProfile() { + const { username } = useParams<{ username: string }>(); + const navigate = useNavigate(); + const [creator, setCreator] = useState(null); + const [isLoading, setIsLoading] = useState(true); + + useEffect(() => { + const fetchCreator = async () => { + if (!username) return; + setIsLoading(true); + try { + const data = await getCreatorByUsername(username); + setCreator(data); + } catch (error) { + console.error("Failed to fetch creator:", error); + setCreator(null); + } finally { + setIsLoading(false); + } + }; + + fetchCreator(); + }, [username]); + + if (isLoading) { + return ( + +
+ +
+
+ ); + } + + if (!creator) { + return ( + +
+
+

Creator Not Found

+

The creator you're looking for doesn't exist.

+ +
+
+
+ ); + } + + return ( + +
+ {/* Background */} +
+
+ +
+
+ {/* Header */} +
+ +
+ + {/* Profile Card */} + + +
+ + + + {creator.username.charAt(0).toUpperCase()} + + + +
+
+

@{creator.username}

+ {creator.devconnect_linked && ( + + + On DevConnect + + )} +
+

{creator.bio}

+ +
+ {creator.primary_arm && ( + + )} + {creator.arm_affiliations && + creator.arm_affiliations + .filter((arm) => arm !== creator.primary_arm) + .map((arm) => ( + + ))} +
+ +
+ {creator.devconnect_link && ( + + )} + +
+
+
+
+
+ + {/* Skills Section */} + {creator.skills && creator.skills.length > 0 && ( + + + Skills & Expertise + + +
+ {creator.skills.map((skill) => ( + + {skill} + + ))} +
+
+
+ )} + + {/* Projects Section */} + {creator.aethex_projects && creator.aethex_projects.length > 0 && ( + + + Portfolio Projects + + +
+ {creator.aethex_projects.map((project) => ( + + + {project.image_url && ( + {project.title} + )} +

+ {project.title} +

+

+ {project.description} +

+ {project.url && ( + + )} + {project.tags && project.tags.length > 0 && ( +
+ {project.tags.map((tag) => ( + + {tag} + + ))} +
+ )} +
+
+ ))} +
+
+
+ )} + + {/* Experience Level */} + + + Experience Level + + + + {creator.experience_level || "Not specified"} + + + +
+
+
+ + ); +}