@@ -2,6 +2,7 @@ import { useOrganization } from '@clerk/shared/react';
22import { useState } from 'react' ;
33
44import { useFetchRoles } from '@/hooks/useFetchRoles' ;
5+ import { Users } from '@/icons' ;
56import { Alert } from '@/ui/elements/Alert' ;
67import { Animated } from '@/ui/elements/Animated' ;
78import { Card } from '@/ui/elements/Card' ;
@@ -11,7 +12,7 @@ import { Tab, TabPanel, TabPanels, Tabs, TabsList } from '@/ui/elements/Tabs';
1112
1213import { NotificationCountBadge , useProtect } from '../../common' ;
1314import { useEnvironment } from '../../contexts' ;
14- import { Col , descriptors , Flex , localizationKeys } from '../../customizables' ;
15+ import { Box , Col , descriptors , Flex , Icon , localizationKeys , Text } from '../../customizables' ;
1516import { Action } from '../../elements/Action' ;
1617import { mqu } from '../../styledSystem' ;
1718import { ActiveMembersList } from './ActiveMembersList' ;
@@ -33,7 +34,7 @@ export const OrganizationMembers = withCardStateProvider(() => {
3334 const [ query , setQuery ] = useState ( '' ) ;
3435 const [ search , setSearch ] = useState ( '' ) ;
3536
36- const { membershipRequests, memberships, invitations } = useOrganization ( {
37+ const { membershipRequests, memberships, invitations, organization } = useOrganization ( {
3738 membershipRequests : isDomainsEnabled || undefined ,
3839 invitations : canManageMemberships || undefined ,
3940 memberships : canReadMemberships
@@ -57,6 +58,7 @@ export const OrganizationMembers = withCardStateProvider(() => {
5758 elementDescriptor = { descriptors . profilePage }
5859 elementId = { descriptors . profilePage . setId ( 'organizationMembers' ) }
5960 gap = { 4 }
61+ sx = { theme => ( { paddingBottom : theme . space . $13 } ) }
6062 >
6163 < Action . Root animate = { false } >
6264 < Animated asChild >
@@ -173,6 +175,46 @@ export const OrganizationMembers = withCardStateProvider(() => {
173175 </ Tabs >
174176 </ Action . Root >
175177 </ Col >
178+
179+ { canReadMemberships && ! ! memberships ?. count && organization && organization . maxAllowedMemberships > 0 ? (
180+ < Box
181+ sx = { theme => ( {
182+ position : 'absolute' ,
183+ bottom : 0 ,
184+ left : 0 ,
185+ right : 0 ,
186+ backgroundColor : theme . colors . $colorBackground ,
187+ borderTop : `1px solid ${ theme . colors . $borderAlpha100 } ` ,
188+ paddingInline : theme . space . $4 ,
189+ height : theme . space . $13 ,
190+ display : 'flex' ,
191+ alignItems : 'center' ,
192+ justifyContent : 'center' ,
193+ } ) }
194+ >
195+ < Text
196+ sx = { t => ( {
197+ display : 'inline-flex' ,
198+ alignItems : 'center' ,
199+ gap : t . space . $2 ,
200+ } ) }
201+ >
202+ < Icon
203+ icon = { Users }
204+ size = 'md'
205+ colorScheme = 'neutral'
206+ />
207+ < Text
208+ as = 'span'
209+ colorScheme = 'inherit'
210+ localizationKey = { localizationKeys ( 'organizationProfile.start.membershipSeatUsageLabel' , {
211+ count : memberships . count + ( invitations ?. count ?? 0 ) ,
212+ limit : organization . maxAllowedMemberships ,
213+ } ) }
214+ />
215+ </ Text >
216+ </ Box >
217+ ) : null }
176218 </ Col >
177219 ) ;
178220} ) ;
0 commit comments