better-auth/apps/web/modules/saas/organizations/lib/active-organization-context.ts

19 lines
516 B
TypeScript
Raw Normal View History

2025-10-29 13:43:43 +05:00
import type { ActiveOrganization } from "@repo/auth";
import React from "react";
export const ActiveOrganizationContext = React.createContext<
| {
activeOrganization: ActiveOrganization | null;
activeOrganizationUserRole:
| ActiveOrganization["members"][number]["role"]
| null;
isOrganizationAdmin: boolean;
loaded: boolean;
setActiveOrganization: (
organizationId: string | null,
) => Promise<void>;
refetchActiveOrganization: () => Promise<void>;
}
| undefined
>(undefined);