Add Oudelaa dashboard API integration
فشلت بعض الفحوصات
Deploy To Ghaymah / deploy (push) Has been cancelled
فشلت بعض الفحوصات
Deploy To Ghaymah / deploy (push) Has been cancelled
هذا الالتزام موجود في:
33
oudelaa_dashboard/components/auth/session-context.tsx
Normal file
33
oudelaa_dashboard/components/auth/session-context.tsx
Normal file
@@ -0,0 +1,33 @@
|
||||
"use client";
|
||||
|
||||
import { createContext, useContext } from "react";
|
||||
|
||||
import type { SuperAdminSessionResponse } from "@/types/api";
|
||||
|
||||
type SuperAdminSessionContextValue = {
|
||||
session: SuperAdminSessionResponse | null;
|
||||
permissions: string[];
|
||||
};
|
||||
|
||||
const SuperAdminSessionContext = createContext<SuperAdminSessionContextValue>({
|
||||
session: null,
|
||||
permissions: [],
|
||||
});
|
||||
|
||||
export function SuperAdminSessionProvider({
|
||||
children,
|
||||
value,
|
||||
}: {
|
||||
children: React.ReactNode;
|
||||
value: SuperAdminSessionContextValue;
|
||||
}) {
|
||||
return (
|
||||
<SuperAdminSessionContext.Provider value={value}>
|
||||
{children}
|
||||
</SuperAdminSessionContext.Provider>
|
||||
);
|
||||
}
|
||||
|
||||
export function useSuperAdminSession() {
|
||||
return useContext(SuperAdminSessionContext);
|
||||
}
|
||||
المرجع في مشكلة جديدة
حظر مستخدم