overleaf/services/web/frontend/js/features/subscription/components/dashboard/managed-institutions.tsx
Davinder Singh c524fee690 Merge pull request #11694 from overleaf/ab-managed-institutions-react
[web] Migrate managed institutions to React dash

GitOrigin-RevId: 535dfafe42d88189bb20e7bb3beac233221ee6ba
2023-02-15 09:04:55 +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}`}
/>
))}
</>
)
}