Files
lume/src/shared/notes/mentions/user.tsx
2023-07-15 21:01:27 +07:00

16 lines
484 B
TypeScript

import { useProfile } from '@utils/hooks/useProfile';
import { shortenKey } from '@utils/shortenKey';
export function MentionUser({ pubkey }: { pubkey: string }) {
const { user } = useProfile(pubkey);
return (
<button
type="button"
className="break-words rounded bg-zinc-800 px-2 py-px text-sm font-normal text-blue-400 no-underline hover:bg-blue-100 hover:text-blue-500"
>
@{user?.name || user?.displayName || shortenKey(pubkey)}
</button>
);
}