@@ -73,3 +73,60 @@ export function NewsFigure({ post }: Readonly<{ post: PostWithTagsAndUser }>) {
73
73
</ figure >
74
74
) ;
75
75
}
76
+ export function NewsSearchFigure ( {
77
+ post,
78
+ } : Readonly < { post : PostWithTagsAndUser } > ) {
79
+ return (
80
+ < figure className = "w-full" >
81
+ < div className = "h-[200px] w-full" >
82
+ < Image
83
+ src = { post . thumbnail }
84
+ alt = { post . slug }
85
+ unoptimized
86
+ height = { 200 }
87
+ width = { 372 }
88
+ className = "h-full w-full object-cover rounded-[20px]"
89
+ />
90
+ </ div >
91
+ < div className = "flex flex-col items-start justify-start gap-[26px]" >
92
+ < div >
93
+ < div className = "mb-[16px] mt-[26px] flex gap-[10px] flex-wrap" >
94
+ { post . tags . map ( ( tag ) => (
95
+ < Tags tag = { tag } key = { tag . tagName } />
96
+ ) ) }
97
+ </ div >
98
+ < Link
99
+ href = { "/berita/" + post . slug }
100
+ className = "text-black hover:text-primary-400 transition-all duration-500"
101
+ >
102
+ < div className = "min-h-[52px]" >
103
+ < span className = "text-[18px] md:text-xl font-bold" >
104
+ { post . title . length > 52
105
+ ? post . title . slice ( 0 , 48 ) + "..."
106
+ : post . title }
107
+ </ span >
108
+ </ div >
109
+ </ Link >
110
+ </ div >
111
+ < div className = "flex w-full justify-between" >
112
+ < div className = "flex items-center gap-2" >
113
+ < Image
114
+ src = { post . user . user_pic }
115
+ alt = { post . user . name + "'s Pfp" }
116
+ unoptimized
117
+ height = { 28 }
118
+ width = { 28 }
119
+ className = "h-7 w-7 object-cover rounded-full"
120
+ />
121
+ < span className = "text-base text-black" >
122
+ { trimName ( post . user . name ) }
123
+ </ span >
124
+ </ div >
125
+ < span className = "text-neutral-500" >
126
+ { post . published_at && stringifyDate ( post . published_at ) }
127
+ </ span >
128
+ </ div >
129
+ </ div >
130
+ </ figure >
131
+ ) ;
132
+ }
0 commit comments