@@ -9,16 +9,51 @@ import {
99} from '@/components/ui/collapsible' ;
1010import Image from 'next/image' ;
1111import Link from 'next/link' ;
12- import { useState } from 'react' ;
12+ import { useState , useEffect } from 'react' ;
13+ import { api } from '@/lib/api' ;
1314
1415interface FAQItem {
1516 question : string ;
1617 answer : string ;
1718 icon ?: React . ElementType ;
1819}
1920
21+ interface AdminUser {
22+ id : number ;
23+ github_username : string ;
24+ added_by : string ;
25+ added_at : string ;
26+ is_active : boolean ;
27+ notes ?: string ;
28+ }
29+
2030export default function AboutPage ( ) {
2131 const [ openFAQ , setOpenFAQ ] = useState < string | null > ( null ) ;
32+ const [ adminUsers , setAdminUsers ] = useState < AdminUser [ ] > ( [ ] ) ;
33+ const [ isLoadingAdmins , setIsLoadingAdmins ] = useState ( true ) ;
34+
35+ useEffect ( ( ) => {
36+ const fetchAdminUsers = async ( ) => {
37+ try {
38+ const users = await api . getAdminUsers ( ) ;
39+ setAdminUsers ( users . filter ( user => user . is_active ) ) ;
40+ } catch ( error ) {
41+ console . error ( 'Failed to fetch admin users:' , error ) ;
42+ // Fallback to hardcoded admin if API fails
43+ setAdminUsers ( [ {
44+ id : 1 ,
45+ github_username : 'pablogsal' ,
46+ added_by : 'system' ,
47+ added_at : new Date ( ) . toISOString ( ) ,
48+ is_active : true
49+ } ] ) ;
50+ } finally {
51+ setIsLoadingAdmins ( false ) ;
52+ }
53+ } ;
54+
55+ fetchAdminUsers ( ) ;
56+ } , [ ] ) ;
2257
2358 const faqItems : FAQItem [ ] = [
2459 {
@@ -313,25 +348,31 @@ export default function AboutPage() {
313348 Reach out via GitHub or the CPython Discord channel
314349 </ p >
315350 < div className = "flex flex-wrap gap-4 justify-center" >
316- { /* Pablo's profile */ }
317- < Link
318- href = "https://github.com/pablogsal"
319- target = "_blank"
320- rel = "noopener noreferrer"
321- className = "flex items-center gap-3 px-4 py-2 rounded-lg bg-background hover:bg-muted group"
322- >
323- < Image
324- src = "https://github.com/pablogsal.png"
325- alt = "Pablo Galindo Salgado"
326- width = { 40 }
327- height = { 40 }
328- className = "rounded-full ring-2 ring-muted group-hover:ring-primary"
329- />
330- < div className = "text-left" >
331- < p className = "font-medium group-hover:text-primary" > Pablo Galindo Salgado</ p >
332- < p className = "text-sm text-muted-foreground" > @pablogsal</ p >
333- </ div >
334- </ Link >
351+ { isLoadingAdmins ? (
352+ < div className = "text-muted-foreground" > Loading maintainers...</ div >
353+ ) : (
354+ adminUsers . map ( ( admin ) => (
355+ < Link
356+ key = { admin . id }
357+ href = { `https://github.com/${ admin . github_username } ` }
358+ target = "_blank"
359+ rel = "noopener noreferrer"
360+ className = "flex items-center gap-3 px-4 py-2 rounded-lg bg-background hover:bg-muted group"
361+ >
362+ < Image
363+ src = { `https://github.com/${ admin . github_username } .png` }
364+ alt = { admin . github_username }
365+ width = { 40 }
366+ height = { 40 }
367+ className = "rounded-full ring-2 ring-muted group-hover:ring-primary"
368+ />
369+ < div className = "text-left" >
370+ < p className = "font-medium group-hover:text-primary" > { admin . github_username } </ p >
371+ < p className = "text-sm text-muted-foreground" > @{ admin . github_username } </ p >
372+ </ div >
373+ </ Link >
374+ ) )
375+ ) }
335376 </ div >
336377 </ div >
337378 </ CardContent >
0 commit comments