@@ -2,12 +2,13 @@ import React from 'react';
22
33import { Label } from '@gravity-ui/uikit' ;
44
5+ import { LoaderWrapper } from '../../../../../components/LoaderWrapper/LoaderWrapper' ;
56import { YDBSyntaxHighlighter } from '../../../../../components/SyntaxHighlighter/YDBSyntaxHighlighter' ;
67import { YDBDefinitionList } from '../../../../../components/YDBDefinitionList/YDBDefinitionList' ;
78import type { YDBDefinitionListItem } from '../../../../../components/YDBDefinitionList/YDBDefinitionList' ;
89import { streamingQueriesApi } from '../../../../../store/reducers/streamingQuery/streamingQuery' ;
910import type { ErrorResponse } from '../../../../../types/api/query' ;
10- import type { TEvDescribeSchemeResult } from '../../../../../types/api/schema' ;
11+ import { EPathType } from '../../../../../types/api/schema' ;
1112import type { IQueryResult } from '../../../../../types/store/query' ;
1213import {
1314 getStringifiedData ,
@@ -21,31 +22,25 @@ import {getEntityName} from '../../../utils';
2122import i18n from './i18n' ;
2223
2324interface StreamingQueryProps {
24- data ?: TEvDescribeSchemeResult ;
2525 database : string ;
2626 path : string ;
2727}
2828
29- /** Displays overview for StreamingQuery EPathType */
30- export function StreamingQueryInfo ( { data, database, path} : StreamingQueryProps ) {
31- const entityName = getEntityName ( data ?. PathDescription ) ;
29+ export function StreamingQueryInfo ( { database, path} : StreamingQueryProps ) {
30+ const entityName = getEntityName ( { Self : { PathType : EPathType . EPathTypeStreamingQuery } } ) ;
3231
33- if ( ! data ) {
34- return (
35- < div className = "error" >
36- { i18n ( 'alert_no-data' ) } { entityName }
37- </ div >
38- ) ;
39- }
40-
41- const { data : sysData } = streamingQueriesApi . useGetStreamingQueryInfoQuery (
32+ const { data : sysData , isFetching} = streamingQueriesApi . useGetStreamingQueryInfoQuery (
4233 { database, path} ,
4334 { skip : ! database || ! path } ,
4435 ) ;
4536
4637 const items = prepareStreamingQueryItems ( sysData ) ;
4738
48- return < YDBDefinitionList title = { entityName } items = { items } /> ;
39+ return (
40+ < LoaderWrapper loading = { isFetching } >
41+ < YDBDefinitionList title = { entityName } items = { items } />
42+ </ LoaderWrapper >
43+ ) ;
4944}
5045
5146const STATE_THEME_MAP : Record < string , React . ComponentProps < typeof Label > [ 'theme' ] > = {
0 commit comments