import React , { useState , FC } from "react" ; import { useWalletNfts } from "@nfteyez/sol-rayz-react" ; const defaultWallet = "3EqUrFrjgABCWAnqMYjZ36GcktiwDtFdkNYwY6C6cDzy" ; export const WalletNfts = ( ) => { const [ walletPublicKey , setWalletPublicKey ] = useState ( defaultWallet ) ; const [ isValidAddress , setIsValidAddress ] = useState ( false ) ; const { nfts , isLoading , error } = useWalletNfts ( { publicAddress : walletPublicKey , } ) ; const onInputChange = ( e ) => { const { value } = e . target ; setWalletPublicKey ( value . trim ( ) ) ; } ; return ( < div > < input type = "text" placeholder = "Enter wallet address" value = { walletPublicKey } onChange = { onInputChange } / > < div > < pre > < b > isValidSolanaAddress ( { walletPublicKey } ) { "->" } { " " } { isValidAddress . toString ( ) } < /b> < /pre> < div > { isLoading ? ( < div > Loading ... < /div>) : (<div> < div > NFT Amount : { nfts ?. length } < /div> < div > Results : < /div> { } < /div>)} { error ? ( < div > < h1 > Error Occures < /h1> { ( error as any ) ?. message } < /div>) : null} < /div> < /div> < /div>); } ;