import { Image } from "@shared/image"; import { DEFAULT_AVATAR } from "@stores/constants"; import { usePageContext } from "@utils/hooks/usePageContext"; import { useProfile } from "@utils/hooks/useProfile"; import { shortenKey } from "@utils/shortenKey"; import { twMerge } from "tailwind-merge"; export default function ChatsListItem({ pubkey }: { pubkey: string }) { const pageContext = usePageContext(); const searchParams: any = pageContext.urlParsed.search; const pagePubkey = searchParams.pubkey; const { user, isError, isLoading } = useProfile(pubkey); return ( <> {isError &&
error
} {isLoading && !user ? (
) : (
{pubkey}
{user.nip05 || user.name || shortenKey(pubkey)}
)} ); }