1- declare const require : any ;
2- const React = require ( "react" ) ;
1+ import React , { type ChangeEvent } from "react" ;
32import useDocusaurusContext from "@docusaurus/useDocusaurusContext" ;
43import Layout from "@theme/Layout" ;
54import Link from "@docusaurus/Link" ;
@@ -47,7 +46,7 @@ export default function Blogs() {
4746 setFilteredBlogs ( filtered ) ;
4847 } , [ searchTerm , selectedCategory ] ) ;
4948
50- const handleSearchChange = ( e : any ) => {
49+ const handleSearchChange = ( e : ChangeEvent < HTMLInputElement > ) => {
5150 setSearchTerm ( e . target . value ) ;
5251 } ;
5352
@@ -146,7 +145,11 @@ export default function Blogs() {
146145 onClick = { ( ) => setSearchTerm ( "" ) }
147146 aria-label = "Clear search"
148147 >
149- < svg viewBox = "0 0 24 24" fill = "none" stroke = "currentColor" >
148+ < svg
149+ viewBox = "0 0 24 24"
150+ fill = "none"
151+ stroke = "currentColor"
152+ >
150153 < line x1 = "18" y1 = "6" x2 = "6" y2 = "18" > </ line >
151154 < line x1 = "6" y1 = "6" x2 = "18" y2 = "18" > </ line >
152155 </ svg >
@@ -219,17 +222,16 @@ export default function Blogs() {
219222 { filteredBlogs . length > 0
220223 ? `Found ${ filteredBlogs . length } article${ filteredBlogs . length !== 1 ? "s" : "" } `
221224 : `No articles found` }
222- { selectedCategory !== "All" &&
223- ` in ${ selectedCategory } ` }
225+ { selectedCategory !== "All" && ` in ${ selectedCategory } ` }
224226 { searchTerm && ` for "${ searchTerm } "` }
225227 </ p >
226228 </ div >
227229 ) }
228230
229231 < div className = "articles-grid" >
230232 { filteredBlogs . length > 0 ? (
231- filteredBlogs . map ( ( blog , index ) => (
232- < BlogCard key = { blog . id ?? blog . slug } blog = { blog } index = { index } />
233+ filteredBlogs . map ( ( blog ) => (
234+ < BlogCard key = { blog . id ?? blog . slug } blog = { blog } />
233235 ) )
234236 ) : (
235237 < div className = "no-results" >
@@ -257,7 +259,7 @@ export default function Blogs() {
257259 ) ;
258260}
259261
260- const BlogCard = ( { blog, index } ) => {
262+ const BlogCard = ( { blog } : { blog : ( typeof blogs ) [ number ] } ) => {
261263 const authors = getAuthorProfiles ( blog . authors || [ ] ) ;
262264
263265 return (
@@ -276,7 +278,7 @@ const BlogCard = ({ blog, index }) => {
276278 < div className = "card-meta" >
277279 < div className = "card-author" >
278280 { /* Stacked Author Avatars */ }
279- { authors . length > 0 && (
281+ { authors . length > 0 &&
280282 ( ( ) => {
281283 const max = 3 ;
282284 const visible = authors . slice ( 0 , max ) ;
@@ -314,28 +316,27 @@ const BlogCard = ({ blog, index }) => {
314316 ) }
315317 </ div >
316318 ) ;
317- } ) ( )
318- ) }
319+ } ) ( ) }
319320
320321 { /* Author Names */ }
321322 < div className = "author-name-group" >
322- { authors . map ( ( author , authorIndex ) => (
323- < span key = { author . id } className = "author-item" >
324- { authorIndex > 0 && (
325- < span className = "author-separator" > & </ span >
326- ) }
327- < Link
328- href = { author . githubUrl }
329- className = "author-name author-link"
330- target = "_blank"
331- rel = "noopener noreferrer"
332- data-author-tooltip = { getAuthorTooltip ( author . id ) }
333- aria-label = { `Open ${ author . name } on GitHub` }
334- >
335- { author . name }
336- </ Link >
337- </ span >
338- ) ) }
323+ { authors . map ( ( author , authorIndex ) => (
324+ < span key = { author . id } className = "author-item" >
325+ { authorIndex > 0 && (
326+ < span className = "author-separator" > & </ span >
327+ ) }
328+ < Link
329+ href = { author . githubUrl }
330+ className = "author-name author-link"
331+ target = "_blank"
332+ rel = "noopener noreferrer"
333+ data-author-tooltip = { getAuthorTooltip ( author . id ) }
334+ aria-label = { `Open ${ author . name } on GitHub` }
335+ >
336+ { author . name }
337+ </ Link >
338+ </ span >
339+ ) ) }
339340 </ div >
340341 </ div >
341342 < span className = "card-read-time" > 5 min read</ span >
0 commit comments