Hey is a decentralized and permissionless social media app built with Lens Protocol 馃尶
at main 38 lines 850 B view raw
1import { useAccountQuery } from "@hey/indexer"; 2import SmallSingleAccountShimmer from "@/components/Shared/Shimmer/SmallSingleAccountShimmer"; 3import SmallSingleAccount from "./SmallSingleAccount"; 4 5interface LazySmallSingleAccountProps { 6 hideSlug?: boolean; 7 address: string; 8 linkToAccount?: boolean; 9} 10 11const LazySmallSingleAccount = ({ 12 hideSlug = false, 13 address, 14 linkToAccount = false 15}: LazySmallSingleAccountProps) => { 16 const { data, loading } = useAccountQuery({ 17 variables: { request: { address } } 18 }); 19 20 if (loading) { 21 return <SmallSingleAccountShimmer smallAvatar />; 22 } 23 24 if (!data?.account) { 25 return null; 26 } 27 28 return ( 29 <SmallSingleAccount 30 account={data.account} 31 hideSlug={hideSlug} 32 linkToAccount={linkToAccount} 33 smallAvatar 34 /> 35 ); 36}; 37 38export default LazySmallSingleAccount;