feat: add nostr profile link

This commit is contained in:
2024-09-23 11:43:06 +01:00
parent c56ec9b62a
commit fb438c0dbc
5 changed files with 680 additions and 63 deletions

View File

@ -0,0 +1,13 @@
import { hexToBech32 } from "@snort/shared";
import { NostrLink } from "@snort/system";
import { useUserProfile } from "@snort/system-react";
export default function Profile({ link }: { link: NostrLink }) {
const profile = useUserProfile(link.id);
return <div className="flex gap-2 items-center">
<img src={profile?.picture} className="w-12 h-12 rounded-full bg-neutral-500" />
<div>
{profile?.display_name ?? profile?.name ?? hexToBech32("npub", link.id).slice(0, 12)}
</div>
</div>
}