diff --git a/client/components/passport/GroupPassport.tsx b/client/components/passport/GroupPassport.tsx new file mode 100644 index 00000000..e4d198c8 --- /dev/null +++ b/client/components/passport/GroupPassport.tsx @@ -0,0 +1,206 @@ +import { Badge } from "@/components/ui/badge"; +import { Button } from "@/components/ui/button"; +import { + Globe, + Github, + Users, + Calendar, + Mail, + MapPin, +} from "lucide-react"; + +interface GroupMember { + userId: string; + role: string; + joinedAt: string; + user: { + id: string; + username: string; + full_name: string; + avatar_url: string | null; + }; +} + +interface Project { + id: string; + title: string; + slug: string; + description: string | null; + image_url: string | null; + created_at: string; +} + +interface GroupPassportProps { + group: { + id: string; + name: string; + description: string | null; + logo_url: string | null; + banner_url: string | null; + website: string | null; + github_url: string | null; + created_at: string; + updated_at: string; + memberCount: number; + members: GroupMember[]; + }; + projects: Project[]; + owner?: { + id: string; + username: string; + full_name: string; + avatar_url: string | null; + }; +} + +export default function GroupPassport({ + group, + projects, + owner, +}: GroupPassportProps) { + const createdDate = new Date(group.created_at).toLocaleDateString("en-US", { + year: "numeric", + month: "long", + day: "numeric", + }); + + return ( +
+ {/* Header Section */} +
+ {group.banner_url && ( +
+ {group.name} +
+ )} +
+
+ {group.logo_url && ( + {group.name} + )} +
+

+ {group.name} +

+

{group.description}

+
+
+ + {group.memberCount} members +
+
+ + Created {createdDate} +
+
+
+
+
+
+ + {/* Links Section */} + {(group.website || group.github_url) && ( +
+ {group.website && ( + + + + )} + {group.github_url && ( + + + + )} +
+ )} + + {/* Members Section */} + {group.members && group.members.length > 0 && ( +
+

Team Members

+
+ {group.members.map((member) => ( +
+ {member.user?.avatar_url && ( + {member.user.full_name} + )} +
+

+ {member.user?.full_name} +

+

+ @{member.user?.username} +

+ + {member.role} + +
+
+ ))} +
+
+ )} + + {/* Projects Section */} + {projects && projects.length > 0 && ( +
+

+ Recent Projects +

+
+ {projects.map((project) => ( +
+ {project.image_url && ( +
+ {project.title} +
+ )} +
+

+ {project.title} +

+ {project.description && ( +

+ {project.description} +

+ )} +

+ {new Date(project.created_at).toLocaleDateString()} +

+
+
+ ))} +
+
+ )} +
+ ); +}