/
githubmirror
/
ydb-embedded-ui
Обзор
Документация
Войти
/
githubmirror
/
ydb-embedded-ui
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
main
src/containers/Tenant/Query/QueryEditor/QueryEditorZeroTabsState.tsx
41 строка
1 KB
Anton Standrik
feat: implement empty state view when the last empty tab is closed (#3796)
16 апр 2026, 13:24
Не верифицирован
16 апр 2026, 13:24
399c66e
Код
Авторство
О чём код?
import {Flex, Hotkey, Text} from '@gravity-ui/uikit'; import {cn} from '../../../../utils/cn'; import i18n from '../i18n'; import {HOTKEY_LABELS} from './constants'; import './QueryEditorZeroTabsState.scss'; const b = cn('ydb-query-editor-zero-tabs-state'); interface QueryEditorZeroTabsStateProps { onCreateTab: VoidFunction; } export function QueryEditorZeroTabsState({onCreateTab}: QueryEditorZeroTabsStateProps) { return ( <Flex className={b()} grow={1} justifyContent="center" alignItems="center"> <button type="button" className={b('card')} onClick={onCreateTab} aria-label={i18n('editor-tabs.empty-state.create-query')} data-qa="query-editor-zero-tabs-state" > <Flex className={b('card-inner')} justifyContent="center" alignItems="center"> <Flex className={b('content')} justifyContent="space-between" alignItems="center" > <Text as="span" variant="subheader-2" className={b('title')}> {i18n('editor-tabs.empty-state.create-query')} </Text> <Hotkey value={HOTKEY_LABELS.newTab} className={b('hotkey')} /> </Flex> </Flex> </button> </Flex> ); }