mirror of
https://github.com/overleaf/overleaf.git
synced 2024-11-07 20:31:06 -05:00
1cde138160
GitOrigin-RevId: b88d765d859f1bdf1eb1d469131c8f239f327562
31 lines
938 B
TypeScript
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 />
|
|
</>
|
|
)
|
|
}
|