LCOV - code coverage report
Current view: top level - dashql-app/src/shell_app - use_shell_query_result.ts Coverage Total Hit
Test: DashQL 915828b Lines: 100.0 % 9 9
Test Date: 2026-11-06 19:30:32

            Line data    Source code
       1              : import * as React from 'react';
       2              : 
       3              : import type { QueryExecutionState } from '../query/query_execution_state.js';
       4              : import type { ShellQueryExecutionTracker } from '../shell/query_execution.js';
       5              : 
       6            1 : export function useShellQueryResult(queryExecutions: ShellQueryExecutionTracker) {
       7            1 :     const [resultQuery, setResultQuery] = React.useState<QueryExecutionState | null>(null);
       8            1 :     const showResultQuery = React.useCallback((queryId: number) => {
       9            1 :         const query = queryExecutions.getSnapshot().find(candidate => candidate.queryId === queryId) ?? null;
      10            1 :         setResultQuery(query);
      11            1 :     }, [queryExecutions]);
      12            1 :     const closeResultQuery = React.useCallback(() => setResultQuery(null), []);
      13              : 
      14            1 :     return { resultQuery, showResultQuery, closeResultQuery };
      15            1 : }
        

Generated by: LCOV version 2.0-1