overleaf/services/web/frontend/js/features/subscription/components/dashboard/managed-institutions.tsx
Alexandre Bourdin d6e9508aed [web] Migrate managed publishers to React dash (#11749)
* Migrate managed publishers to React dash

* Decaf cleanup + async/await PublishersGetter

* Continue migration of managed publishers to react dash

* Fix linting

* Add tests

* Decaf cleanup PublishersGetterTests

* Update PublishersGetter tests

* Rename component files to kebab-case

GitOrigin-RevId: cb1fe14d120457c965a9d23a8ddb2c2c92e1d5da
2023-02-23 09:04:03 +00:00

31 lines
697 B
TypeScript

import { useSubscriptionDashboardContext } from '../../context/subscription-dashboard-context'
import ManagedInstitution from './managed-institution'
export type Institution = {
v1Id: number
managerIds: string[]
metricsEmail: {
optedOutUserIds: string[]
lastSent: Date
}
name: string
}
export default function ManagedInstitutions() {
const { managedInstitutions } = useSubscriptionDashboardContext()
if (!managedInstitutions) {
return null
}
return (
<>
{managedInstitutions.map(institution => (
<ManagedInstitution
institution={institution}
key={`managed-institution-${institution.v1Id}`}
/>
))}
</>
)
}