/ src / hooks / useDiagnosticsHook.ts
useDiagnosticsHook.ts
 1  // Copyright (c) 2026 VPL Solutions. All rights reserved.
 2  // Licensed under the MIT License. See LICENSE for details.
 3  
 4  import { useContext } from 'react';
 5  import { DiagnosticsContext } from './DiagnosticsContext';
 6  
 7  export function useDiagnostics() {
 8    const ctx = useContext(DiagnosticsContext);
 9    if (!ctx) throw new Error('useDiagnostics must be used within DiagnosticsProvider');
10    return ctx;
11  }