overleaf/services/web/frontend/js/features/settings/components/managed-account-alert.tsx
Jakob Ackermann aa480a2663 Merge pull request #18898 from overleaf/jpa-no-window
[web] migrate from window attributes to getMeta

GitOrigin-RevId: 3dcf1ab6b01155e5e4abeb3e78d0fa9053e055bc
2024-06-19 08:04:21 +00:00

42 lines
1.1 KiB
TypeScript

import { Trans, useTranslation } from 'react-i18next'
import getMeta from '@/utils/meta'
import Notification from '@/shared/components/notification'
export default function ManagedAccountAlert() {
const { t } = useTranslation()
const isManaged = getMeta('ol-isManagedAccount')
const currentManagedUserAdminEmail = getMeta(
'ol-currentManagedUserAdminEmail'
)
if (!isManaged) {
return null
}
return (
<Notification
type="info"
content={
<>
<div>
<strong>
{t('account_managed_by_group_administrator', {
admin: currentManagedUserAdminEmail,
})}
</strong>
</div>
<Trans
i18nKey="need_contact_group_admin_to_make_changes"
components={[
// eslint-disable-next-line jsx-a11y/anchor-has-content, react/jsx-key
<a
href="/learn/how-to/Understanding_Managed_Overleaf_Accounts"
target="_blank"
/>,
]}
/>
</>
}
/>
)
}