import { Fragment } from 'react' import { useTranslation, Trans } from 'react-i18next' import getMeta from '../../../utils/meta' import { UserEmailsProvider, useUserEmailsContext, } from '../context/user-email-context' import EmailsHeader from './emails/header' import EmailsRow from './emails/row' import Icon from '../../../shared/components/icon' import { Alert } from 'react-bootstrap' import { ExposedSettings } from '../../../../../types/exposed-settings' function EmailsSectionContent() { const { t } = useTranslation() const { state: { data: userEmailsData }, isInitializing, isInitializingSuccess, isInitializingError, } = useUserEmailsContext() const userEmails = Object.values(userEmailsData.byId) return ( <>

{t('emails_and_affiliations_title')}

{t('emails_and_affiliations_explanation')}

{/* eslint-disable-next-line jsx-a11y/anchor-has-content */}

{isInitializing && (
{t('loading')}...
)} {isInitializingSuccess && ( <> {userEmails?.map((userEmail, i) => ( {i + 1 !== userEmails.length && (
)} ))} )} {isInitializingError && ( {' '} {t('error_performing_request')} )} ) } function EmailsSection() { const { hasAffiliationsFeature } = getMeta( 'ol-ExposedSettings' ) as ExposedSettings if (!hasAffiliationsFeature) { return null } return ( <>
) } export default EmailsSection