Skip to content

Commit 7e5b7b6

Browse files
committed
fix: move to separate container
1 parent 2b48695 commit 7e5b7b6

File tree

2 files changed

+31
-21
lines changed

2 files changed

+31
-21
lines changed
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
import {Button, Icon, Text} from '@gravity-ui/uikit';
2+
3+
import {cn} from '../../../../../utils/cn';
4+
import i18n from '../i18n';
5+
6+
import CryCatIcon from '../../../../../assets/icons/cry-cat.svg';
7+
8+
const b = cn('kv-top-queries');
9+
10+
interface NotFoundContainerProps {
11+
onClose: () => void;
12+
}
13+
14+
export const NotFoundContainer = ({onClose}: NotFoundContainerProps) => {
15+
return (
16+
<div className={b('not-found-container')}>
17+
<Icon data={CryCatIcon} size={100} />
18+
<Text variant="subheader-2" className={b('not-found-title')}>
19+
{i18n('query-details.not-found.title')}
20+
</Text>
21+
<Text variant="body-1" color="complementary" className={b('not-found-description')}>
22+
{i18n('query-details.not-found.description')}
23+
</Text>
24+
<Button size="m" view="normal" className={b('not-found-close')} onClick={onClose}>
25+
{i18n('query-details.close')}
26+
</Button>
27+
</div>
28+
);
29+
};

src/containers/Tenant/Diagnostics/TopQueries/QueryDetails/QueryDetailsDrawerContent.tsx

Lines changed: 2 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
import React from 'react';
22

3-
import {Button, Icon, Text} from '@gravity-ui/uikit';
43
import {useHistory, useLocation} from 'react-router-dom';
54

65
import {parseQuery} from '../../../../../routes';
@@ -11,18 +10,13 @@ import {
1110
TENANT_QUERY_TABS_ID,
1211
} from '../../../../../store/reducers/tenant/constants';
1312
import type {KeyValueRow} from '../../../../../types/api/query';
14-
import {cn} from '../../../../../utils/cn';
1513
import {useTypedDispatch} from '../../../../../utils/hooks';
1614
import {TenantTabsGroups, getTenantPath} from '../../../TenantPages';
17-
import i18n from '../i18n';
1815
import {createQueryInfoItems} from '../utils';
1916

17+
import {NotFoundContainer} from './NotFoundContainer';
2018
import {QueryDetails} from './QueryDetails';
2119

22-
import CryCatIcon from '../../../../../assets/icons/cry-cat.svg';
23-
24-
const b = cn('kv-top-queries');
25-
2620
interface QueryDetailsDrawerContentProps {
2721
row: KeyValueRow | null;
2822
onClose: () => void;
@@ -61,18 +55,5 @@ export const QueryDetailsDrawerContent = ({row, onClose}: QueryDetailsDrawerCont
6155
);
6256
}
6357

64-
return (
65-
<div className={b('not-found-container')}>
66-
<Icon data={CryCatIcon} size={100} />
67-
<Text variant="subheader-2" className={b('not-found-title')}>
68-
{i18n('query-details.not-found.title')}
69-
</Text>
70-
<Text variant="body-1" color="complementary" className={b('not-found-description')}>
71-
{i18n('query-details.not-found.description')}
72-
</Text>
73-
<Button size="m" view="normal" className={b('not-found-close')} onClick={onClose}>
74-
{i18n('query-details.close')}
75-
</Button>
76-
</div>
77-
);
58+
return <NotFoundContainer onClose={onClose} />;
7859
};

0 commit comments

Comments
 (0)