import useLocalState from "@/state/state";
import Sigil from "./Sigil";
import { isValidPatp } from "urbit-ob";
import type { UserProfile, UserType } from "@/types/nostrill";
import Icon from "@/components/Icon";
import UserModal from "./modals/UserModal";
export default function ({
user,
userString,
size,
color,
noClickOnName,
profile,
picOnly = false,
}: {
user: UserType;
userString: string;
size: number;
color?: string;
noClickOnName?: boolean;
profile?: UserProfile;
picOnly?: boolean;
}) {
const { setModal } = useLocalState((s) => ({ setModal: s.setModal }));
// TODO revisit this when %whom updates
console.log({ profile });
const avatarInner = profile ? (
) : "urbit" in user && isValidPatp(user.urbit) ? (
{profile.name}
) : "urbit" in user ? ({user.urbit.length > 28 ? "Anon" : user.urbit}
) : ({user.nostr}
)}