import React from 'react'; import { Link } from 'react-router-dom'; import { isPubkey } from 'soapbox/utils/nostr'; import { Tooltip } from './ui'; import type { Mention as MentionEntity } from 'soapbox/schemas'; interface IMention { mention: Pick; disabled?: boolean; } /** Mention for display in post content and the composer. */ const Mention: React.FC = ({ mention: { acct, username }, disabled }) => { const handleClick: React.MouseEventHandler = (e) => { if (disabled) { e.preventDefault(); e.stopPropagation(); } }; return ( @{isPubkey(username) ? username.slice(0, 8) : acct} ); }; export default Mention;