2023-02-14 05:21:25 -05:00
|
|
|
import { useSubscriptionDashboardContext } from '../../context/subscription-dashboard-context'
|
2023-02-22 06:50:24 -05:00
|
|
|
import ManagedInstitution from './managed-institution'
|
2023-02-14 05:21:25 -05:00
|
|
|
|
|
|
|
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}`}
|
|
|
|
/>
|
|
|
|
))}
|
|
|
|
</>
|
|
|
|
)
|
|
|
|
}
|