/
githubmirror
/
ydb-embedded-ui
Обзор
Документация
Войти
/
githubmirror
/
ydb-embedded-ui
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
main
src/containers/Tenant/Query/QuerySettingsDialog/TimeoutLabel.tsx
49 строк
1 KB
Anton Standrik
fix: disable streaming by default for some clusters (#2566)
14 июл 2025, 18:01
Не верифицирован
14 июл 2025, 18:01
a9670eb
Код
Авторство
О чём код?
import {HelpMark, Switch} from '@gravity-ui/uikit'; import {cn} from '../../../../utils/cn'; import {useQueryStreamingSetting} from '../../../../utils/hooks'; import {QUERY_SETTINGS_FIELD_SETTINGS} from './constants'; import i18n from './i18n'; import './TimeoutLabel.scss'; const b = cn('ydb-timeout-label'); interface TimeoutLabelProps { isDisabled?: boolean; isChecked: boolean; onToggle: (enabled: boolean) => void; } export function TimeoutLabel({isDisabled, isChecked, onToggle}: TimeoutLabelProps) { const [isQueryStreamingEnabled] = useQueryStreamingSetting(); if (isQueryStreamingEnabled) { return ( <div className={b('switch-title')}> <Switch disabled={isDisabled} checked={isChecked} onUpdate={onToggle} className={b('switch')} content={QUERY_SETTINGS_FIELD_SETTINGS.timeout.title} /> {isDisabled && ( <HelpMark className={b('question-icon')} popoverProps={{placement: 'bottom-start'}} > {i18n('form.timeout.disabled')} </HelpMark> )} </div> ); } return ( <label htmlFor="timeout" className={b('label-title')}> {QUERY_SETTINGS_FIELD_SETTINGS.timeout.title} </label> ); }