overleaf/services/web/frontend/js/features/subscription/components/dashboard/group-subscription-memberships.tsx
Thomas Mees 1cde138160 Move premium features link outside the subscription block
GitOrigin-RevId: b88d765d859f1bdf1eb1d469131c8f239f327562
2023-09-06 08:05:47 +00:00

31 lines
938 B
TypeScript

import { MemberGroupSubscription } from '../../../../../../types/subscription/dashboard/subscription'
import { useSubscriptionDashboardContext } from '../../context/subscription-dashboard-context'
import GroupSubscriptionMembership from './group-subscription-membership'
import LeaveGroupModal from './leave-group-modal'
export default function GroupSubscriptionMemberships() {
const { memberGroupSubscriptions } = useSubscriptionDashboardContext()
if (!memberGroupSubscriptions) {
return null
}
const memberOnlyGroupSubscriptions = memberGroupSubscriptions.filter(
subscription => !subscription.userIsGroupManager
)
return (
<>
{memberOnlyGroupSubscriptions.map(
(subscription: MemberGroupSubscription) => (
<GroupSubscriptionMembership
subscription={subscription}
key={subscription._id}
/>
)
)}
<LeaveGroupModal />
</>
)
}