overleaf/services/web/frontend/js/features/settings/components/integration-linking-section.tsx
Timothée Alby cf2dfc6bf1 Merge pull request #7593 from overleaf/ta-settings-migration
[SettingsPage] Integration Branch

GitOrigin-RevId: 5a3c26b2a02d716c4ae3981e3f08b811ae307725
2022-04-25 08:05:12 +00:00

46 lines
1.1 KiB
TypeScript

import { useTranslation } from 'react-i18next'
import importOverleafModules from '../../../../macros/import-overleaf-module.macro'
const integrationLinkingWidgets = importOverleafModules(
'integrationLinkingWidgets'
)
function IntegrationLinkingSection() {
const { t } = useTranslation()
return (
<>
<h3>{t('integrations')}</h3>
<p>{t('linked_accounts_explained')}</p>
<div className="settings-widgets-container">
{integrationLinkingWidgets.map(
({ import: importObject, path }, widgetIndex) => (
<IntegrationLinkingWidget
key={Object.keys(importObject)[0]}
ModuleComponent={Object.values(importObject)[0]}
isLast={widgetIndex === integrationLinkingWidgets.length - 1}
/>
)
)}
</div>
</>
)
}
type IntegrationLinkingWidgetProps = {
ModuleComponent: any
isLast: boolean
}
function IntegrationLinkingWidget({
ModuleComponent,
isLast,
}: IntegrationLinkingWidgetProps) {
return (
<>
<ModuleComponent />
{isLast ? null : <hr />}
</>
)
}
export default IntegrationLinkingSection