@@ -22,15 +22,27 @@ type MinimalThread = Pick<TThread, "_id" | "title"> & { likes: number };
2222
2323function HeartIcon ( props : React . SVGProps < SVGSVGElement > ) {
2424 return (
25- < svg viewBox = "0 0 24 24" fill = "none" stroke = "currentColor" strokeWidth = "1.8" { ...props } >
25+ < svg
26+ viewBox = "0 0 24 24"
27+ fill = "none"
28+ stroke = "currentColor"
29+ strokeWidth = "1.8"
30+ { ...props }
31+ >
2632 < path d = "M20.84 4.61a5.5 5.5 0 0 0-7.78 0L12 5.67l-1.06-1.06a5.5 5.5 0 0 0-7.78 7.78l1.06 1.06L12 21.23l7.78-7.78 1.06-1.06a5.5 5.5 0 0 0 0-7.78z" />
2733 </ svg >
2834 ) ;
2935}
3036
3137function UsersIcon ( props : React . SVGProps < SVGSVGElement > ) {
3238 return (
33- < svg viewBox = "0 0 24 24" fill = "none" stroke = "currentColor" strokeWidth = "1.8" { ...props } >
39+ < svg
40+ viewBox = "0 0 24 24"
41+ fill = "none"
42+ stroke = "currentColor"
43+ strokeWidth = "1.8"
44+ { ...props }
45+ >
3446 < path d = "M17 21v-2a4 4 0 0 0-4-4H7a4 4 0 0 0-4 4v2" />
3547 < circle cx = "9" cy = "7" r = "4" />
3648 < path d = "M23 21v-2a4 4 0 0 0-3-3.87" />
@@ -40,7 +52,10 @@ function UsersIcon(props: React.SVGProps<SVGSVGElement>) {
4052}
4153
4254function SectionHeader ( {
43- icon, title, count, action,
55+ icon,
56+ title,
57+ count,
58+ action,
4459} : {
4560 icon : "heart" | "users" ;
4661 title : string ;
@@ -57,7 +72,9 @@ function SectionHeader({
5772 < h2 className = "text-lg font-bold text-[#3c69b4] leading-[1.8rem]" >
5873 { title }
5974 { typeof count !== "undefined" && (
60- < span className = "ml-2 text-sm font-medium text-gray-400" > { count } </ span >
75+ < span className = "ml-2 text-sm font-medium text-gray-400" >
76+ { count }
77+ </ span >
6178 ) }
6279 </ h2 >
6380 </ div >
@@ -104,7 +121,12 @@ function SigCard({ sig }: { sig: Sig }) {
104121 } }
105122 >
106123 { maxMatch ( sig . name ) . map ( ( name , index ) => (
107- < span key = { index } className = "break-words drop-shadow-[0_1px_0_rgba(0,0,0,0.15)]" > { name } </ span >
124+ < span
125+ key = { index }
126+ className = "break-words drop-shadow-[0_1px_0_rgba(0,0,0,0.15)]"
127+ >
128+ { name }
129+ </ span >
108130 ) ) }
109131 </ div >
110132 </ Link >
@@ -141,7 +163,8 @@ export default function Information() {
141163 const all = ( json ?. data ?? [ ] ) as Sig [ ] ;
142164 setSigs ( all ) ;
143165 } catch ( err : any ) {
144- if ( err ?. name !== "AbortError" ) setSigsError ( err ?. message || "Failed to load SIGs." ) ;
166+ if ( err ?. name !== "AbortError" )
167+ setSigsError ( err ?. message || "Failed to load SIGs." ) ;
145168 } finally {
146169 setSigsLoading ( false ) ;
147170 }
@@ -152,7 +175,11 @@ export default function Information() {
152175
153176 // Top posts
154177 const pageSize = 3 ;
155- const { data, isLoading : postsLoading , isError : postsError } = useTopPost ( { pageSize } ) ;
178+ const {
179+ data,
180+ isLoading : postsLoading ,
181+ isError : postsError ,
182+ } = useTopPost ( { pageSize } ) ;
156183
157184 const posts : MinimalThread [ ] = useMemo ( ( ) => {
158185 const raw = Array . isArray ( ( data as any ) ?. pages )
@@ -164,7 +191,12 @@ export default function Information() {
164191 return ( raw as any [ ] ) . map ( ( item ) => ( {
165192 _id : item . _id ,
166193 title : item . title ,
167- likes : typeof item . likes === "number" ? item . likes : typeof item . like === "number" ? item . like : 0 ,
194+ likes :
195+ typeof item . likes === "number"
196+ ? item . likes
197+ : typeof item . like === "number"
198+ ? item . like
199+ : 0 ,
168200 } ) ) ;
169201 } , [ data ] ) ;
170202
@@ -177,8 +209,8 @@ export default function Information() {
177209 . filter ( ( s ) =>
178210 q
179211 ? s . name . toLowerCase ( ) . includes ( q ) ||
180- ( s . customId ?. toLowerCase ( ) . includes ( q ) ?? false )
181- : true
212+ ( s . customId ?. toLowerCase ( ) . includes ( q ) ?? false )
213+ : true ,
182214 ) ;
183215 } , [ sigs , sigQuery ] ) ;
184216
@@ -195,11 +227,15 @@ export default function Information() {
195227 < SectionHeader icon = "heart" title = "Top 3 Posts" />
196228 < div className = "mt-2 flex flex-col divide-y divide-gray-100" >
197229 { postsError && (
198- < p className = "text-sm text-red-500" > Failed to load posts. Please try again later.</ p >
230+ < p className = "text-sm text-red-500" >
231+ Failed to load posts. Please try again later.
232+ </ p >
199233 ) }
200234
201235 { ! postsError && posts . length === 0 && (
202- < p className = "text-sm text-gray-500" > No posts yet. Check back soon!</ p >
236+ < p className = "text-sm text-gray-500" >
237+ No posts yet. Check back soon!
238+ </ p >
203239 ) }
204240
205241 { ! postsError && posts . length > 0 && (
@@ -222,7 +258,9 @@ export default function Information() {
222258 count = { filteredSigs . length }
223259 action = {
224260 < div className = "relative" >
225- < label htmlFor = "sig-search" className = "sr-only" > Search SIGs</ label >
261+ < label htmlFor = "sig-search" className = "sr-only" >
262+ Search SIGs
263+ </ label >
226264 < input
227265 id = "sig-search"
228266 value = { sigQuery }
@@ -235,7 +273,9 @@ export default function Information() {
235273 />
236274
237275 < div className = "absolute top-[2.6rem] left-0 right-0 bottom-0 mt-2 overflow-y-auto custom-scrollbar" >
238- { sigsError && < p className = "text-sm text-red-500 px-0.5" > { sigsError } </ p > }
276+ { sigsError && (
277+ < p className = "text-sm text-red-500 px-0.5" > { sigsError } </ p >
278+ ) }
239279
240280 { ! sigsError && (
241281 < ul className = "flex flex-wrap items-start justify-center gap-4 px-0.5" >
0 commit comments