File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -28,26 +28,29 @@ const DocList = () => {
2828 } ;
2929
3030 fetchDocs ( ) ;
31- } , [ ] ) ;
31+ } , [ ] ) ;
3232
3333
3434
35- if ( loading ) return < div className = "flex justify-center items-center h-screen" > < Spin size = "large" /> </ div > ;
3635 if ( error ) return < Alert message = "Error" description = { error } type = "error" /> ;
3736
3837 return (
3938 < Layout >
4039 < div className = "container mx-auto p-4 min-h-screen" >
4140 < MainTitle highlight = { 'Documentation' } />
42- < ul className = 'grid gap-5 mx-auto md:max-w-2xl' >
41+ { loading ? (
42+ < div className = 'grid place-content-center mx-auto md:max-w-2xl aspect-video' >
43+ < Spin size = "large" />
44+ </ div >
45+ ) : ( < ul className = 'grid gap-5 mx-auto md:max-w-2xl' >
4346 {
4447 docs . map ( item =>
45- < Link to = { item . title } className = 'capitalize group flex items-center justify-between bg-white/10 p-5 rounded-md' > { item . title . replace ( / _ / g, ' ' ) }
48+ < Link key = { item . title } to = { item . title } className = 'capitalize group flex items-center justify-between bg-white/10 p-5 rounded-md' > { item . title . replace ( / _ / g, ' ' ) }
4649 < FaArrowRight className = "dark:text-white opacity-0 group-hover:opacity-100 -translate-x-10 group-hover:translate-x-0 transition duration-300" />
4750 </ Link >
4851 )
4952 }
50- </ ul >
53+ </ ul > ) }
5154 </ div >
5255 </ Layout >
5356 ) ;
You can’t perform that action at this time.
0 commit comments