import { Popover, Transition } from '@headlessui/react'; import { Fragment } from 'react'; import { Link } from 'react-router-dom'; import { Image } from '@shared/image'; import { DEFAULT_AVATAR } from '@stores/constants'; import { formatCreatedAt } from '@utils/createdAt'; import { useProfile } from '@utils/hooks/useProfile'; import { shortenKey } from '@utils/shortenKey'; export function User({ pubkey, time, size, isRepost = false, isChat = false, }: { pubkey: string; time: number; size?: string; isRepost?: boolean; isChat?: boolean; }) { const { status, user } = useProfile(pubkey); const createdAt = formatCreatedAt(time, isChat); const avatarWidth = size === 'small' ? 'w-6' : 'w-11'; const avatarHeight = size === 'small' ? 'h-6' : 'h-11'; if (status === 'loading') { return (
{user?.about}