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 function ChatsListSelfItem({ data }: { data: any }) { const pageContext = usePageContext(); const searchParams: any = pageContext.urlParsed.search; const pagePubkey = searchParams.pubkey; const { user, isError, isLoading } = useProfile(data.pubkey); return ( <> {isError &&
error
} {isLoading && !user ? (
) : (
{data.pubkey}
{user?.nip05 || user?.name || shortenKey(data.pubkey)}
(you)
)} ); }