Files
zap.stream/src/element/mention.tsx
Alejandro Gomez 111eea3d14 feat: profile page
2023-06-30 19:06:55 +02:00

16 lines
449 B
TypeScript

import { Link } from "react-router-dom";
import { useUserProfile } from "@snort/system-react";
import { System } from "index";
import { hexToBech32 } from "utils";
interface MentionProps {
pubkey: string;
relays?: string[];
}
export function Mention({ pubkey, relays }: MentionProps) {
const user = useUserProfile(System, pubkey);
const npub = hexToBech32("npub", pubkey);
return <Link to={`/p/${npub}`}>{user?.name || pubkey}</Link>;
}