()
| 33 | // renders any member data or admin controls. The APIs remain the authority for |
| 34 | // every admin mutation. |
| 35 | function AdminPage() { |
| 36 | useExecutorDocumentTitle("Admin"); |
| 37 | const members = useAtomValue(orgMembersAtom); |
| 38 | const access = AsyncResult.match(members, { |
| 39 | onInitial: (): AdminAccess => "loading", |
| 40 | onFailure: (): AdminAccess => "denied", |
| 41 | onSuccess: ({ value }): AdminAccess => |
| 42 | isTenantAdminMember(value.members as readonly TenantMemberRow[]) ? "allowed" : "denied", |
| 43 | }); |
| 44 | |
| 45 | return ( |
| 46 | <div className="min-h-0 flex-1 overflow-y-auto"> |
| 47 | <div className="mx-auto flex max-w-3xl flex-col gap-10 px-6 py-10 lg:px-8 lg:py-14"> |
| 48 | {access === "loading" ? ( |
| 49 | <Notice>Checking admin access…</Notice> |
| 50 | ) : access === "allowed" ? ( |
| 51 | <AdminConsole /> |
| 52 | ) : ( |
| 53 | <AdminAccessDenied /> |
| 54 | )} |
| 55 | </div> |
| 56 | </div> |
| 57 | ); |
| 58 | } |
| 59 | |
| 60 | function AdminConsole() { |
| 61 | return ( |
nothing calls this directly
no test coverage detected