File tree Expand file tree Collapse file tree 1 file changed +21
-10
lines changed
apps/dashboard/src/app/(app)/(dashboard)/(chain)/[chain_id]/[contractAddress]/nfts/[tokenId] Expand file tree Collapse file tree 1 file changed +21
-10
lines changed Original file line number Diff line number Diff line change 22
33import { ExternalLinkIcon } from "lucide-react" ;
44import Link from "next/link" ;
5- import { useState } from "react" ;
5+ import { Suspense , useState } from "react" ;
66import type { NFT , ThirdwebClient , ThirdwebContract } from "thirdweb" ;
77import { getNFT as getErc721NFT } from "thirdweb/extensions/erc721" ;
88import { getNFT as getErc1155NFT } from "thirdweb/extensions/erc1155" ;
@@ -89,7 +89,7 @@ export const TokenIdPage: React.FC<TokenIdPageProps> = ({
8989
9090 if ( isPending ) {
9191 return (
92- < div className = "flex h-[400px] items-center justify-center" >
92+ < div className = "flex h-[400px] items-center justify-center py-20 " >
9393 < Spinner className = "size-10" />
9494 </ div >
9595 ) ;
@@ -179,15 +179,26 @@ export const TokenIdPage: React.FC<TokenIdPageProps> = ({
179179 < NFTDetailsTab client = { contract . client } nft = { nft } />
180180 ) }
181181
182- { tabs . map ( ( tb ) => {
183- return (
184- tb . title === tab && (
185- < div className = "w-full" key = { tb . title } >
186- { tb . children }
182+ < Suspense
183+ fallback = {
184+ < div className = "h-full" >
185+ < div className = "flex items-center gap-1.5" >
186+ < Spinner className = "size-4" />
187+ < p className = "text-sm text-muted-foreground" > Loading </ p >
187188 </ div >
188- )
189- ) ;
190- } ) }
189+ </ div >
190+ }
191+ >
192+ { tabs . map ( ( tb ) => {
193+ return (
194+ tb . title === tab && (
195+ < div className = "w-full" key = { tb . title } >
196+ { tb . children }
197+ </ div >
198+ )
199+ ) ;
200+ } ) }
201+ </ Suspense >
191202 </ div >
192203 </ div >
193204 </ div >
You can’t perform that action at this time.
0 commit comments