diff --git a/src/components/display-name-row.tsx b/src/components/display-name-row.tsx new file mode 100644 index 000000000..ac617ff0a --- /dev/null +++ b/src/components/display-name-row.tsx @@ -0,0 +1,45 @@ +import React from 'react'; + +import { useSoapboxConfig } from 'soapbox/hooks'; + +import { getAcct } from '../utils/accounts'; + +import { HStack, Text } from './ui'; +import VerificationBadge from './verification-badge'; + +import type { Account } from 'soapbox/schemas'; + +interface IDisplayName { + account: Pick; + withSuffix?: boolean; +} + +const DisplayNameRow: React.FC = ({ account, withSuffix = true }) => { + const { displayFqn = false } = useSoapboxConfig(); + const { verified } = account; + + const displayName = ( + + + + {verified && } + + ); + + const suffix = (@{getAcct(account, displayFqn)}); + + return ( +
+ {displayName} + - + {withSuffix && suffix} +
+ ); +}; + +export default DisplayNameRow;