import React from "react"; import { useHistory } from "react-router-dom"; import { useTranslation } from 'react-i18next'; export function UsernameText({ username, ...props }: any) { const history = useHistory(); const { t } = useTranslation(); return ( history.push(`/${username}`)} {...props} > {username || t('social:username')} ); }