import { NavLink } from 'react-router-dom'; import { twMerge } from 'tailwind-merge'; import { Image } from '@shared/image'; import { useProfile } from '@utils/hooks/useProfile'; import { displayNpub } from '@utils/shortenKey'; export function ChatsListItem({ pubkey }: { pubkey: string }) { const { status, user } = useProfile(pubkey); if (status === 'loading') { return (
); } return ( twMerge( 'flex h-10 items-center gap-2.5 rounded-r-lg border-l-2 pl-4 pr-3', isActive ? 'border-fuchsia-500 bg-white/5 text-white' : 'border-transparent text-white/70' ) } > {pubkey}
{user?.name || user?.display_name || user?.displayName || displayNpub(pubkey, 16)}
); }