Files
lume/src/app/note/components/user/mention.tsx
2023-05-07 12:42:40 +07:00

10 lines
378 B
TypeScript

import { useProfile } from '@lume/utils/hooks/useProfile';
import { shortenKey } from '@lume/utils/shortenKey';
export const NoteMentionUser = (props: { children: any[] }) => {
const pubkey = props.children[0];
const { user } = useProfile(pubkey);
return <span className="cursor-pointer text-fuchsia-500">@{user?.username || user?.name || shortenKey(pubkey)}</span>;
};