import { createContext, useContext } from "react";

/** `basename`: admin-only app under `BrowserRouter basename={adminUiPrefix}`. `absolute`: full site `App`. */
export type AdminRouterMode = "basename" | "absolute";

const AdminRouterModeCtx = createContext<AdminRouterMode>("absolute");

export const AdminRouterModeProvider = AdminRouterModeCtx.Provider;

export function useAdminRouterMode(): AdminRouterMode {
  return useContext(AdminRouterModeCtx);
}
