الملفات
boutmoun123 8863f61d00
فشلت بعض الفحوصات
Deploy To Ghaymah / deploy (push) Has been cancelled
Add Oudelaa dashboard API integration
2026-05-25 20:36:52 +03:00

34 أسطر
729 B
TypeScript

"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);
}