import { truncate } from '@utils/truncate'; import { memo, useEffect, useState } from 'react'; export const UserRepost = memo(function UserRepost({ pubkey }: { pubkey: string }) { const [profile, setProfile] = useState({ picture: null, name: null }); useEffect(() => { fetch(`https://rbr.bio/${pubkey}/metadata.json`).then((res) => res.json().then((res) => { // update state setProfile(JSON.parse(res.content)); }) ); }, [pubkey]); return (

{profile.name ? profile.name : truncate(pubkey, 16, ' .... ')} repost

); });