2023-01-18 09:38:35 -05:00
|
|
|
import { useTranslation } from 'react-i18next'
|
|
|
|
import getMeta from '../../../../utils/meta'
|
|
|
|
import InstitutionMemberships from './institution-memberships'
|
2023-01-18 09:38:51 -05:00
|
|
|
import FreePlan from './free-plan'
|
2023-01-26 11:48:30 -05:00
|
|
|
import PersonalSubscription from './personal-subscription'
|
2023-01-18 09:38:35 -05:00
|
|
|
|
|
|
|
function SubscriptionDashboard() {
|
|
|
|
const { t } = useTranslation()
|
|
|
|
const institutionMemberships = getMeta('ol-currentInstitutionsWithLicence')
|
2023-01-26 11:48:30 -05:00
|
|
|
const subscription = getMeta('ol-subscription')
|
|
|
|
|
|
|
|
const hasDisplayedSubscription =
|
|
|
|
institutionMemberships?.length > 0 || subscription
|
2023-01-18 09:38:35 -05:00
|
|
|
|
|
|
|
return (
|
|
|
|
<div className="container">
|
|
|
|
<div className="row">
|
|
|
|
<div className="col-md-8 col-md-offset-2">
|
|
|
|
<div className="card">
|
|
|
|
<div className="page-header">
|
|
|
|
<h1>{t('your_subscription')}</h1>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
<InstitutionMemberships memberships={institutionMemberships} />
|
2023-01-26 11:48:30 -05:00
|
|
|
<PersonalSubscription subscription={subscription} />
|
|
|
|
{!hasDisplayedSubscription && <FreePlan />}
|
2023-01-18 09:38:35 -05:00
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
)
|
|
|
|
}
|
|
|
|
|
|
|
|
export default SubscriptionDashboard
|