1- import { Mail , Globe } from 'lucide-react' ;
1+ "use client"
2+
3+ import { Avatar , AvatarFallback , AvatarImage } from "@/components/ui/avatar"
4+ import {
5+ Dialog ,
6+ DialogContent ,
7+ DialogDescription ,
8+ DialogHeader ,
9+ DialogTitle ,
10+ DialogTrigger ,
11+ } from "@/components/ui/dialog"
12+ import { Separator } from "@/components/ui/separator"
13+ import { Calendar , Mail , User } from "lucide-react"
14+ import { useState } from "react"
215
316interface TeamMemberProps {
4- name : string ;
5- role : string ;
6- image : string ;
7- bio : string ;
8- email ?: string ;
9- website ?: string ;
17+ name : string
18+ role : string
19+ image : string
20+ bio : string
21+ email ?: string
22+ website ?: string
23+ research_interests ?: string
24+ professional_career ?: Array < {
25+ period : string
26+ position : string
27+ } >
28+ education ?: Array < {
29+ period : string
30+ degree : string
31+ } >
1032}
1133
1234export default function TeamMemberCard ( {
@@ -16,41 +38,137 @@ export default function TeamMemberCard({
1638 bio,
1739 email,
1840 website,
41+ research_interests,
42+ professional_career,
43+ education,
1944} : TeamMemberProps ) {
45+ const [ isOpen , setIsOpen ] = useState ( false )
46+
2047 return (
21- < div className = "flex flex-col items-center space-y-4 rounded-lg border p-6 text-center" >
22- < div className = "relative h-32 w-32 overflow-hidden rounded-full" >
23- < img
24- src = { image }
25- alt = { name }
26- className = "h-full w-full object-cover"
27- />
28- </ div >
29- < div className = "space-y-2" >
30- < h3 className = "text-xl font-bold" > { name } </ h3 >
31- < p className = "text-sm text-muted-foreground" > { role } </ p >
32- < p className = "text-sm" > { bio } </ p >
33- </ div >
34- < div className = "flex space-x-4" >
35- { email && (
36- < a
37- href = { `mailto:${ email } ` }
38- className = "text-muted-foreground hover:text-foreground"
39- >
40- < Mail className = "h-5 w-5" />
41- </ a >
42- ) }
43- { website && (
44- < a
45- href = { website }
46- target = "_blank"
47- rel = "noopener noreferrer"
48- className = "text-muted-foreground hover:text-foreground"
49- >
50- < Globe className = "h-5 w-5" />
51- </ a >
52- ) }
53- </ div >
54- </ div >
55- ) ;
48+ < Dialog open = { isOpen } onOpenChange = { setIsOpen } >
49+ < DialogTrigger asChild >
50+ < div className = "flex flex-col items-center space-y-4 rounded-lg border p-6 text-center cursor-pointer hover:bg-accent/50 transition-colors" >
51+ < Avatar className = "h-24 w-24" >
52+ < AvatarImage src = { `/saezlab.org-draft/team_images/${ image } ` } alt = { name } />
53+ < AvatarFallback >
54+ { name
55+ . split ( " " )
56+ . map ( ( n ) => n [ 0 ] )
57+ . join ( "" ) }
58+ </ AvatarFallback >
59+ </ Avatar >
60+ < div className = "space-y-2" >
61+ < h3 className = "text-xl font-bold" > { name } </ h3 >
62+ < p className = "text-sm text-muted-foreground" > { role } </ p >
63+ </ div >
64+ </ div >
65+ </ DialogTrigger >
66+ < DialogContent className = "sm:max-w-[800px] max-h-[85vh] overflow-y-auto p-6" >
67+ < DialogHeader className = "flex flex-col sm:flex-row sm:items-start gap-4 mb-6" >
68+ < Avatar className = "w-28 h-28 border" >
69+ < AvatarImage src = { `/saezlab.org-draft/team_images/${ image } ` } alt = { name } />
70+ < AvatarFallback >
71+ { name
72+ . split ( " " )
73+ . map ( ( n ) => n [ 0 ] )
74+ . join ( "" ) }
75+ </ AvatarFallback >
76+ </ Avatar >
77+ < div className = "space-y-2" >
78+ < DialogTitle className = "text-2xl" > { name } </ DialogTitle >
79+ < DialogDescription className = "text-lg font-medium" > { role } </ DialogDescription >
80+ </ div >
81+ </ DialogHeader >
82+
83+ < div className = "space-y-8" >
84+ { /* Biography Section */ }
85+ < section >
86+ < h3 className = "font-semibold text-xl mb-3" > Biography</ h3 >
87+ < p className = "text-muted-foreground" > { bio } </ p >
88+ </ section >
89+
90+ { research_interests && (
91+ < >
92+ < Separator />
93+ < section >
94+ < h3 className = "font-semibold text-xl mb-3" > Research Interests</ h3 >
95+ < p className = "text-muted-foreground" > { research_interests } </ p >
96+ </ section >
97+ </ >
98+ ) }
99+
100+ { professional_career && professional_career . length > 0 && (
101+ < >
102+ < Separator />
103+ < section >
104+ < h3 className = "font-semibold text-xl mb-3" > Professional Career</ h3 >
105+ < div className = "space-y-5" >
106+ { professional_career . map ( ( item , index ) => (
107+ < div key = { index } className = "flex gap-4" >
108+ < div className = "flex-shrink-0 mt-1" >
109+ < Calendar className = "h-5 w-5 text-muted-foreground" />
110+ </ div >
111+ < div >
112+ < p className = "font-medium" > { item . period } </ p >
113+ < p className = "text-muted-foreground" > { item . position } </ p >
114+ </ div >
115+ </ div >
116+ ) ) }
117+ </ div >
118+ </ section >
119+ </ >
120+ ) }
121+
122+ { education && education . length > 0 && (
123+ < >
124+ < Separator />
125+ < section >
126+ < h3 className = "font-semibold text-xl mb-3" > Education</ h3 >
127+ < div className = "space-y-5" >
128+ { education . map ( ( item , index ) => (
129+ < div key = { index } className = "flex gap-4" >
130+ < div className = "flex-shrink-0 mt-1" >
131+ < Calendar className = "h-5 w-5 text-muted-foreground" />
132+ </ div >
133+ < div >
134+ < p className = "font-medium" > { item . period } </ p >
135+ < p className = "text-muted-foreground" > { item . degree } </ p >
136+ </ div >
137+ </ div >
138+ ) ) }
139+ </ div >
140+ </ section >
141+ </ >
142+ ) }
143+
144+ { ( email || website ) && (
145+ < >
146+ < Separator />
147+ < section >
148+ < h3 className = "font-semibold text-xl mb-3" > Contact Information</ h3 >
149+ < div className = "space-y-3" >
150+ { email && (
151+ < div className = "flex items-center gap-2" >
152+ < Mail className = "h-5 w-5 text-muted-foreground" />
153+ < a href = { `mailto:${ email } ` } className = "text-blue-600 hover:underline" >
154+ { email }
155+ </ a >
156+ </ div >
157+ ) }
158+ { website && (
159+ < div className = "flex items-center gap-2" >
160+ < User className = "h-5 w-5 text-muted-foreground" />
161+ < a href = { website } target = "_blank" rel = "noopener noreferrer" className = "text-blue-600 hover:underline" >
162+ Website
163+ </ a >
164+ </ div >
165+ ) }
166+ </ div >
167+ </ section >
168+ </ >
169+ ) }
170+ </ div >
171+ </ DialogContent >
172+ </ Dialog >
173+ )
56174}
0 commit comments