diff --git a/apps/www/registry/default/ui/nft-card.tsx b/apps/www/registry/default/ui/nft-card.tsx index 0440e1d..0d74536 100644 --- a/apps/www/registry/default/ui/nft-card.tsx +++ b/apps/www/registry/default/ui/nft-card.tsx @@ -1,3 +1,4 @@ +import { useEffect, useState } from "react" import { fetchDigitalAsset, mplTokenMetadata, @@ -42,9 +43,19 @@ const NftCard = async ({ mintAddress, ...props }: NftCardProps) => { - const umi = createUmi(process.env.NEXT_PUBLIC_QUICKNODE!).use(mplTokenMetadata()) + const [nftData, setNftData] = useState(null) + const umi = createUmi(process.env.NEXT_PUBLIC_QUICKNODE!).use( + mplTokenMetadata() + ) + + useEffect(() => { + const fetchNftData = async () => { + const nftData = await fetchDigitalAsset(umi, publicKey(mintAddress)) + setNftData(nftData) + } + fetchNftData() + }, []) - const nftData = await fetchDigitalAsset(umi, publicKey(mintAddress)) console.log(nftData) return (