import { Popover, Transition } from "@headlessui/react"; 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"; import { Fragment } from "react"; import { Link } from "react-router-dom"; export function User({ pubkey, time, size, repost, isChat = false, }: { pubkey: string; time: number; size?: string; repost?: boolean; isChat?: boolean; }) { const { user } = useProfile(pubkey); const createdAt = formatCreatedAt(time, isChat); const avatarWidth = size === "small" ? "w-6" : "w-11"; const avatarHeight = size === "small" ? "h-6" : "h-11"; return ( {pubkey}
{user?.nip05 || user?.name || shortenKey(pubkey)}
{repost && ( {" "} reposted )} ยท {createdAt}
{pubkey}
{user?.displayName || user?.name || (
)}
{user?.nip05 || shortenKey(pubkey)}

{user?.about}

View profile Message
); }