import { createContext, useContext } from "react"; import type { AdminContextValue } from "./types"; export const AdminContext = createContext(undefined); export const useAdminContext = () => { const ctx = useContext(AdminContext); if (!ctx) { throw new Error("useAdminContext must be used within "); } return ctx; };