useSystemActions.ts
1 import { useContext } from "react"; 2 import { 3 SystemActionsContext, 4 type SystemActionsState, 5 } from "./system-actions-context"; 6 7 export function useSystemActions(): SystemActionsState { 8 const ctx = useContext(SystemActionsContext); 9 if (!ctx) { 10 throw new Error( 11 "useSystemActions must be used within a SystemActionsProvider", 12 ); 13 } 14 return ctx; 15 }