"use client"; import { useState, useEffect, useRef } from "react"; import { useTranslation } from "@/app/hooks/useTranslation"; import ReadyToJoin from "@/app/components/gallery/ReadyToJoin"; const BASE = process.env.NEXT_PUBLIC_BASE_PATH || ""; type MemberItem = { name: string; logo: string; subtitle: string; }; type Category = { title: string; items: MemberItem[]; }; type IndividualMember = { name: string; title: string; }; /* Stateful Logo Card component to dynamically adjust padding & scaling based on image aspect ratio */ const LogoCard = ({ item }: { item: MemberItem }) => { const [isSquareOrTall, setIsSquareOrTall] = useState(false); const imgRef = useRef(null); useEffect(() => { const img = imgRef.current; if (!img) return; // Reset aspect ratio state when logo path changes setIsSquareOrTall(false); const handleLoad = () => { const { naturalWidth, naturalHeight } = img; if (naturalHeight && naturalWidth) { // If height-to-width ratio is close to square or taller (>= 0.75) setIsSquareOrTall(naturalHeight / naturalWidth >= 0.75); } }; if (img.complete) { handleLoad(); } else { img.addEventListener("load", handleLoad); return () => img.removeEventListener("load", handleLoad); } }, [item.logo]); const hasLogo = item.logo && item.logo.trim() !== ""; return (
{/* Card containing the logo image or fallback placeholder */}
{hasLogo ? ( /* Logo Container with background fill for high contrast */
{/* eslint-disable-next-line @next/next/no-img-element */} {item.name}
) : ( /* Fallback avatar badge */
{item.name.slice(0, 2).toUpperCase()}
)}
{/* Text details (outside on the dark background, larger text) */}
{item.name} {item.subtitle}
); }; export default function MembersPageClient() { const { members } = useTranslation(); const categories = members.organizationalMembers.categories; return (
{/* Hero Header Section */}
{members.hero.eyebrow}

{members.hero.title}

{members.hero.description}

{/* Jump Anchors Navigation Menu */}
{members.organizationalMembers.title} {members.contributingMembers.title}
{/* Organizational Members Section */}

{members.organizationalMembers.title}

{members.organizationalMembers.description}

{/* Subcategories */}
{Object.entries(categories).map(([key, cat]) => { const category = cat as Category; return (
{/* Subcategory title */}

{category.title}

{/* Logos Grid */}
{category.items.map((item) => ( ))}
); })}
{/* Contributing Members Section */}

{members.contributingMembers.title}

{members.contributingMembers.description}

{/* Individual Contributors Grid */}
{members.contributingMembers.items.map((item: IndividualMember) => (

{item.name}

{item.title}

))}
{/* Ready To Join CTA Section (Reusing Visual Gallery CTA design) */}
); }