diff --git a/src/app/(centered)/select-org/[[...state]]/SelectOrg.tsx b/src/app/(centered)/select-org/[[...state]]/SelectOrg.tsx index 39c8cac855..e72a10b965 100644 --- a/src/app/(centered)/select-org/[[...state]]/SelectOrg.tsx +++ b/src/app/(centered)/select-org/[[...state]]/SelectOrg.tsx @@ -1,10 +1,59 @@ -import { OrganizationList } from '@clerk/nextjs'; +'use client'; + +import Link from 'next/link'; +import { OrganizationList, useOrganizationList } from '@clerk/nextjs'; +import { LoaderCircle } from 'lucide-react'; + +import { Button } from '@/components/ui'; export const SelectOrg = ({ state }: { state?: string }) => { + const { isLoaded, userMemberships, userSuggestions, userInvitations } = + useOrganizationList({ + userMemberships: true, + userInvitations: true, + userSuggestions: true, + }); + const redirectUrl = state ? `/extension/sign-in?state=${state}` : '/dashboard'; + const isLoading = + !isLoaded || + userMemberships.isLoading || + userInvitations.isLoading || + userSuggestions.isLoading; + + if (isLoading) { + return ( +
+ +
+ ); + } + + const isBlocked = + userMemberships.count === 0 && + userInvitations.count === 0 && + userSuggestions.count === 0; + + if (isBlocked) { + return ( +
+
+
Roo Code Cloud is in closed beta.
+
+ +
+
+
+ ); + } + return (