Files
Foxel/web/src/contexts/SystemContext.tsx
2026-02-09 13:19:28 +08:00

12 lines
391 B
TypeScript

import { createContext, useContext } from 'react';
import type { SystemStatus } from '../api/config';
export const SystemContext = createContext<SystemStatus | null>(null);
export const useSystemStatus = () => {
const context = useContext(SystemContext);
if (context === undefined) {
throw new Error('useSystemStatus must be used within a SystemProvider');
}
return context;
};