overleaf/services/web/frontend/js/features/subscription/components/dashboard/managed-publisher.tsx
Alf Eaton 0c81bccfca Ensure that translation values are correctly escaped (#15252)
GitOrigin-RevId: 5a38b4c01921fd4d95dbdb7b9e756443fdb00b80
2023-10-20 08:03:31 +00:00

40 lines
1.1 KiB
TypeScript

import { Trans, useTranslation } from 'react-i18next'
import { Publisher } from './managed-publishers'
import { RowLink } from './row-link'
type ManagedPublisherProps = {
publisher: Publisher
}
export default function ManagedPublisher({ publisher }: ManagedPublisherProps) {
const { t } = useTranslation()
return (
<div>
<p>
<Trans
i18nKey="you_are_a_manager_of_publisher_x"
components={[<strong />]} // eslint-disable-line react/jsx-key
values={{
publisherName: publisher.name || '',
}}
shouldUnescape
tOptions={{ interpolation: { escapeValue: true } }}
/>
</p>
<RowLink
href={`/publishers/${publisher.slug}/hub`}
heading={t('view_hub')}
subtext={t('view_hub_subtext')}
icon="account_circle"
/>
<RowLink
href={`/manage/publishers/${publisher.slug}/managers`}
heading={t('manage_publisher_managers')}
subtext={t('manage_managers_subtext')}
icon="manage_accounts"
/>
<hr />
</div>
)
}