@@ -16,6 +16,15 @@ export default function PeoplePage() {
1616 const currentMembers = peopleData . filter ( p => p . status === "current" )
1717 const alumni = peopleData . filter ( p => p . status === "alumni" )
1818
19+ // Helper function to get primary link (website > scholar > other)
20+ const getPrimaryLink = ( person : typeof peopleData [ 0 ] ) => {
21+ if ( ! person . links ) return null
22+ if ( person . links . website ) return person . links . website
23+ if ( person . links . scholar ) return person . links . scholar
24+ const otherLinks = Object . values ( person . links )
25+ return otherLinks . length > 0 ? otherLinks [ 0 ] : null
26+ }
27+
1928 const pi = currentMembers . find ( p => p . role === "Principal Investigator" )
2029 const phd = currentMembers . filter ( p => p . role === "PhD Student" )
2130 const masters = currentMembers . filter ( p => p . role === "Master Student" )
@@ -66,7 +75,20 @@ export default function PeoplePage() {
6675 </ div >
6776 ) }
6877 < div className = "flex-1" >
69- < CardTitle className = "text-2xl" > { pi . name } </ CardTitle >
78+ < CardTitle className = "text-2xl" >
79+ { getPrimaryLink ( pi ) ? (
80+ < a
81+ href = { getPrimaryLink ( pi ) as string }
82+ target = "_blank"
83+ rel = "noopener noreferrer"
84+ className = "hover:underline"
85+ >
86+ { pi . name }
87+ </ a >
88+ ) : (
89+ pi . name
90+ ) }
91+ </ CardTitle >
7092 < CardDescription className = "mt-2 text-lg" > { pi . title } </ CardDescription >
7193 { pi . bio && (
7294 < p className = "mt-4 leading-relaxed text-muted-foreground" > { pi . bio } </ p >
@@ -133,7 +155,20 @@ export default function PeoplePage() {
133155 </ div >
134156 ) }
135157 < div className = "min-w-0 flex-1" >
136- < CardTitle className = "text-lg leading-tight" > { person . name } </ CardTitle >
158+ < CardTitle className = "text-lg leading-tight" >
159+ { getPrimaryLink ( person ) ? (
160+ < a
161+ href = { getPrimaryLink ( person ) as string }
162+ target = "_blank"
163+ rel = "noopener noreferrer"
164+ className = "hover:underline"
165+ >
166+ { person . name }
167+ </ a >
168+ ) : (
169+ person . name
170+ ) }
171+ </ CardTitle >
137172 < p className = "mt-1 text-sm text-muted-foreground" > { person . role } </ p >
138173 </ div >
139174 </ div >
@@ -200,7 +235,20 @@ export default function PeoplePage() {
200235 </ div >
201236 ) }
202237 < div className = "min-w-0 flex-1" >
203- < CardTitle className = "text-lg leading-tight" > { person . name } </ CardTitle >
238+ < CardTitle className = "text-lg leading-tight" >
239+ { getPrimaryLink ( person ) ? (
240+ < a
241+ href = { getPrimaryLink ( person ) as string }
242+ target = "_blank"
243+ rel = "noopener noreferrer"
244+ className = "hover:underline"
245+ >
246+ { person . name }
247+ </ a >
248+ ) : (
249+ person . name
250+ ) }
251+ </ CardTitle >
204252 < p className = "mt-1 text-sm text-muted-foreground" > { person . role } </ p >
205253 </ div >
206254 </ div >
@@ -268,7 +316,20 @@ export default function PeoplePage() {
268316 </ div >
269317 ) }
270318 < div className = "min-w-0 flex-1" >
271- < CardTitle className = "text-lg leading-tight" > { person . name } </ CardTitle >
319+ < CardTitle className = "text-lg leading-tight" >
320+ { getPrimaryLink ( person ) ? (
321+ < a
322+ href = { getPrimaryLink ( person ) as string }
323+ target = "_blank"
324+ rel = "noopener noreferrer"
325+ className = "hover:underline"
326+ >
327+ { person . name }
328+ </ a >
329+ ) : (
330+ person . name
331+ ) }
332+ </ CardTitle >
272333 < p className = "mt-1 text-sm text-muted-foreground" > { person . role } </ p >
273334 </ div >
274335 </ div >
@@ -334,7 +395,20 @@ export default function PeoplePage() {
334395 </ div >
335396 ) }
336397 < div className = "min-w-0 flex-1" >
337- < CardTitle className = "text-lg leading-tight" > { person . name } </ CardTitle >
398+ < CardTitle className = "text-lg leading-tight" >
399+ { getPrimaryLink ( person ) ? (
400+ < a
401+ href = { getPrimaryLink ( person ) as string }
402+ target = "_blank"
403+ rel = "noopener noreferrer"
404+ className = "hover:underline"
405+ >
406+ { person . name }
407+ </ a >
408+ ) : (
409+ person . name
410+ ) }
411+ </ CardTitle >
338412 < p className = "mt-1 text-sm text-muted-foreground" > { person . role } </ p >
339413 </ div >
340414 </ div >
@@ -397,7 +471,20 @@ export default function PeoplePage() {
397471 </ div >
398472 ) }
399473 < div className = "min-w-0 flex-1" >
400- < CardTitle className = "text-lg leading-tight" > { person . name } </ CardTitle >
474+ < CardTitle className = "text-lg leading-tight" >
475+ { getPrimaryLink ( person ) ? (
476+ < a
477+ href = { getPrimaryLink ( person ) as string }
478+ target = "_blank"
479+ rel = "noopener noreferrer"
480+ className = "hover:underline"
481+ >
482+ { person . name }
483+ </ a >
484+ ) : (
485+ person . name
486+ ) }
487+ </ CardTitle >
401488 < p className = "mt-1 text-sm text-muted-foreground" > { person . role } </ p >
402489 </ div >
403490 </ div >
@@ -462,7 +549,20 @@ export default function PeoplePage() {
462549 </ div >
463550 ) }
464551 < div className = "min-w-0 flex-1" >
465- < CardTitle className = "text-lg leading-tight" > { person . name } </ CardTitle >
552+ < CardTitle className = "text-lg leading-tight" >
553+ { getPrimaryLink ( person ) ? (
554+ < a
555+ href = { getPrimaryLink ( person ) as string }
556+ target = "_blank"
557+ rel = "noopener noreferrer"
558+ className = "hover:underline"
559+ >
560+ { person . name }
561+ </ a >
562+ ) : (
563+ person . name
564+ ) }
565+ </ CardTitle >
466566 { person . degree && (
467567 < Badge variant = "outline" className = "mt-1 text-xs" > { person . degree } </ Badge >
468568 ) }
0 commit comments