1- import React from ' react'
1+ import React from " react" ;
22
3- export default function AuthorPost ( { post} ) {
3+ export default function AuthorPost ( { post } ) {
4+ const { authors } = post ;
45
5- const { authors} = post
6-
7- if ( typeof authors [ 1 ] === "object" ) {
8- return (
9- < div className = "flex flex-start" >
10- { post . authors . map ( ( item , idx ) => {
11- return (
12- < section className = "flex flew-row mb-6 mr-4" >
13- < div className = "relative" >
14- < div
15- className = "rounded-full bg-sdv-highlight top-0 left-0"
16- style = { {
17- width : "49px" ,
18- height : "49px" ,
19- } }
20- >
21- < div
22- className = "overflow-hidden rounded-full absolute bottom-0 right-0"
23- style = { {
24- width : "46px" ,
25- height : "46px" ,
26- } }
27- >
28- { item . profile_image ? (
29- < img
30- width = { 46 }
31- height = { 46 }
32- className = "block rounded-full relative z-10 object-cover h-full"
33- src = {
34- item . profile_image
35- }
36- alt = { item . name }
37- />
38- ) : (
39- < img
40- width = { 46 }
41- height = { 46 }
42- className = "block rounded-full relative z-10 object-cover h-full"
43- src = "/blog/images/icons/avatar.svg"
44- alt = { item . name }
45- />
46- ) }
47- </ div >
48- </ div >
49- </ div >
50- < div className = "text-xs px-4 flex flex-col justify-center" >
51- < p className = "text-sm" >
52- < strong className = "font-bold " > { item . name } </ strong >
53- </ p >
54- </ div >
55- </ section >
56- )
57- } ) }
58- </ div >
59- )
60- }
61-
62- return (
63- < section className = "flex flew-row mb-6" >
64- < div className = "relative" >
65- < div
66- className = "rounded-full bg-sdv-highlight top-0 left-0"
67- style = { {
68- width : "48px" ,
69- height : "48px" ,
70- } }
71- >
72- < div
73- className = "overflow-hidden rounded-full absolute bottom-0 right-0"
6+ if ( typeof authors [ 1 ] === "object" ) {
7+ return (
8+ < div className = "flex flex-start" >
9+ { post . authors . map ( ( item ) => {
10+ return (
11+ < section key = { item . name } className = "flex flew-row mb-6 mr-4" >
12+ < div className = "relative" >
13+ < div
14+ className = "rounded-full bg-sdv-highlight top-0 left-0"
7415 style = { {
16+ width : "49px" ,
17+ height : "49px" ,
18+ } }
19+ >
20+ < div
21+ className = "overflow-hidden rounded-full absolute bottom-0 right-0"
22+ style = { {
7523 width : "46px" ,
7624 height : "46px" ,
77- } }
78- >
79- { post . primary_author . profile_image ? (
25+ } }
26+ >
27+ { item . profile_image ? (
8028 < img
81- width = { 46 }
82- height = { 46 }
83- className = "block rounded-full relative z-10 object-cover h-full"
84- src = {
85- post . primary_author
86- . profile_image
87- }
88- alt = { post . primary_author . name }
29+ width = { 46 }
30+ height = { 46 }
31+ className = "block rounded-full relative z-10 object-cover h-full"
32+ src = { item . profile_image }
33+ alt = { item . name }
8934 />
90- ) : (
35+ ) : (
9136 < img
92- width = { 46 }
93- height = { 46 }
94- className = "block rounded-full relative z-10 object-cover h-full"
95- src = "/blog/images/icons/avatar.svg"
96- alt = { post . primary_author . name }
37+ width = { 46 }
38+ height = { 46 }
39+ className = "block rounded-full relative z-10 object-cover h-full"
40+ src = "/blog/images/icons/avatar.svg"
41+ alt = { item . name }
9742 />
98- ) }
43+ ) }
44+ </ div >
45+ </ div >
9946 </ div >
47+ < div className = "text-xs px-4 flex flex-col justify-center" >
48+ < p className = "text-sm" >
49+ < strong className = "font-bold " > { item . name } </ strong >
50+ </ p >
51+ </ div >
52+ </ section >
53+ ) ;
54+ } ) }
55+ </ div >
56+ ) ;
57+ }
58+
59+ return (
60+ < section className = "flex flew-row mb-6" >
61+ < div className = "relative" >
62+ < div
63+ className = "rounded-full bg-sdv-highlight top-0 left-0"
64+ style = { {
65+ width : "48px" ,
66+ height : "48px" ,
67+ } }
68+ >
69+ < div
70+ className = "overflow-hidden rounded-full absolute bottom-0 right-0"
71+ style = { {
72+ width : "46px" ,
73+ height : "46px" ,
74+ } }
75+ >
76+ { post . primary_author . profile_image ? (
77+ < img
78+ width = { 46 }
79+ height = { 46 }
80+ className = "block rounded-full relative z-10 object-cover h-full"
81+ src = { post . primary_author . profile_image }
82+ alt = { post . primary_author . name }
83+ />
84+ ) : (
85+ < img
86+ width = { 46 }
87+ height = { 46 }
88+ className = "block rounded-full relative z-10 object-cover h-full"
89+ src = "/blog/images/icons/avatar.svg"
90+ alt = { post . primary_author . name }
91+ />
92+ ) }
10093 </ div >
94+ </ div >
10195 </ div >
10296 < div className = "text-xs px-4 flex flex-col justify-center" >
103- < p className = "text-sm" >
104- < strong className = "font-bold" > { post . primary_author . name } </ strong >
105- </ p >
97+ < p className = "text-sm" >
98+ < strong className = "font-bold" > { post . primary_author . name } </ strong >
99+ </ p >
106100 </ div >
107- </ section >
108- )
109- }
101+ </ section >
102+ ) ;
103+ }
0 commit comments