overleaf/services/web/frontend/js/features/settings/components/emails/email.tsx
ilkin-overleaf 5b0c122f5d Merge pull request #7290 from overleaf/ii-7154-list-user-emails
List of user emails

GitOrigin-RevId: 28a8e405812932ba7ebd8043a4dc9d3c573a68b2
2022-04-11 08:03:38 +00:00

41 lines
1.2 KiB
TypeScript

import { useTranslation } from 'react-i18next'
import { UserEmailData } from '../../../../../../types/user-email'
import ResendConfirmationEmailButton from './resend-confirmation-email-button'
type EmailProps = {
userEmailData: UserEmailData
}
function Email({ userEmailData }: EmailProps) {
const { t } = useTranslation()
return (
<>
{userEmailData.email}
{userEmailData.default ? ' (primary)' : ''}
{!userEmailData.confirmedAt && (
<div className="small">
<strong>
{t('unconfirmed')}.
{!userEmailData.ssoAvailable && (
<span> {t('please_check_your_inbox')}.</span>
)}
</strong>
<br />
{!userEmailData.ssoAvailable && (
<ResendConfirmationEmailButton email={userEmailData.email} />
)}
</div>
)}
{userEmailData.confirmedAt &&
userEmailData.affiliation?.institution.confirmed &&
userEmailData.affiliation?.licence !== 'free' && (
<div className="small">
<span className="label label-primary">{t('professional')}</span>
</div>
)}
</>
)
}
export default Email