@@ -6,6 +6,7 @@ interface AuthorCardProps {
66 author ?: string ;
77 authorURL ?: string ;
88 authorImageURL ?: string ;
9+ authors ?: string [ ] ;
910 date ?: string ;
1011 readTime ?: string ;
1112 className ?: string ;
@@ -37,10 +38,93 @@ export function AuthorCard({
3738 author,
3839 authorURL,
3940 authorImageURL,
41+ authors,
4042 date,
4143 readTime,
4244 className,
4345} : AuthorCardProps ) {
46+ // Handle multiple authors case
47+ if ( authors && authors . length > 0 ) {
48+ const formattedDate = date
49+ ? new Date ( date ) . toLocaleDateString ( "en-US" , {
50+ month : "short" ,
51+ day : "numeric" ,
52+ year : "numeric" ,
53+ } )
54+ : null ;
55+
56+ return (
57+ < div
58+ className = { cn ( "flex flex-wrap items-center gap-2 text-sm text-muted-foreground" , className ) }
59+ >
60+ { authors . flatMap ( ( authorName , index ) => {
61+ const githubUrl = `https://github.com/${ encodeURIComponent ( authorName ) } ` ;
62+ const avatarUrl = ! authorName . includes ( " " )
63+ ? `https://github.com/${ encodeURIComponent ( authorName ) } .png`
64+ : null ;
65+
66+ const elements = [ ] ;
67+
68+ if ( avatarUrl ) {
69+ elements . push (
70+ < div className = "relative shrink-0" key = { `${ authorName } -${ index } -avatar` } >
71+ < Link
72+ href = { githubUrl }
73+ target = "_blank"
74+ rel = "noopener noreferrer"
75+ className = "block leading-none"
76+ >
77+ < Avatar className = "h-6 w-6 border border-border/50" >
78+ < AvatarImage src = { avatarUrl } alt = { authorName } className = "object-cover" />
79+ < AvatarFallback > { authorName . charAt ( 0 ) . toUpperCase ( ) } </ AvatarFallback >
80+ </ Avatar >
81+ </ Link >
82+ </ div > ,
83+ ) ;
84+ }
85+
86+ elements . push (
87+ < div className = "font-semibold text-foreground" key = { `${ authorName } -${ index } -name` } >
88+ < Link
89+ href = { githubUrl }
90+ target = "_blank"
91+ rel = "noopener noreferrer"
92+ className = "hover:underline"
93+ >
94+ { authorName }
95+ </ Link >
96+ </ div > ,
97+ ) ;
98+
99+ if ( index < authors . length - 1 ) {
100+ elements . push (
101+ < span aria-hidden = "true" key = { `${ authorName } -${ index } -comma` } >
102+ ,
103+ </ span > ,
104+ ) ;
105+ }
106+
107+ return elements ;
108+ } ) }
109+
110+ { readTime && (
111+ < >
112+ < span aria-hidden = "true" > ·</ span >
113+ < span > { readTime } read</ span >
114+ </ >
115+ ) }
116+
117+ { formattedDate && (
118+ < >
119+ < span aria-hidden = "true" > ·</ span >
120+ < time dateTime = { date } > { formattedDate } </ time >
121+ </ >
122+ ) }
123+ </ div >
124+ ) ;
125+ }
126+
127+ // Handle single author case (backward compatibility)
44128 if ( ! author && ! date ) return null ;
45129
46130 const githubUrl = sanitizeAuthorUrl ( authorURL ) ;
0 commit comments