mirror of
https://github.com/overleaf/overleaf.git
synced 2024-12-03 09:44:03 -05:00
f86eeac522
[web] Migrate group subscription memberships to React dash GitOrigin-RevId: d5ff3ae4e5d8c422530502af22edda6c24c9a593
32 lines
1 KiB
TypeScript
32 lines
1 KiB
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, index: number) => (
|
|
<GroupSubscriptionMembership
|
|
subscription={subscription}
|
|
isLast={index === memberOnlyGroupSubscriptions.length - 1}
|
|
key={subscription._id}
|
|
/>
|
|
)
|
|
)}
|
|
|
|
<LeaveGroupModal />
|
|
</>
|
|
)
|
|
}
|