Skip to content

Commit 2ce5ea6

Browse files
refactor(LabelWithPopover): rename props
1 parent aaa9dbd commit 2ce5ea6

File tree

3 files changed

+15
-23
lines changed

3 files changed

+15
-23
lines changed

src/components/LabelWithPopover/LabelWithPopover.tsx

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -3,18 +3,14 @@ import type {ReactNode} from 'react';
33
import {HelpPopover} from '@gravity-ui/uikit';
44

55
interface LabelWithPopoverProps {
6-
headerText: string;
7-
popoverContent: ReactNode;
6+
text: string;
7+
content: ReactNode;
88
className?: string;
99
}
1010

11-
export const LabelWithPopover = ({
12-
headerText,
13-
popoverContent,
14-
className,
15-
}: LabelWithPopoverProps) => (
11+
export const LabelWithPopover = ({text, content, className}: LabelWithPopoverProps) => (
1612
<div className={className}>
17-
{headerText}
18-
<HelpPopover content={popoverContent} />
13+
{text}
14+
<HelpPopover content={content} />
1915
</div>
2016
);

src/containers/Tenant/Diagnostics/Consumers/Headers/Headers.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,8 @@ const b = block('ydb-diagnostics-consumers-columns-header');
1414
export const ReadLagsHeader = () => (
1515
<LabelWithPopover
1616
className={b('lags')}
17-
headerText={CONSUMERS_COLUMNS_TITILES[CONSUMERS_COLUMNS_IDS.READ_LAGS]}
18-
popoverContent={
17+
text={CONSUMERS_COLUMNS_TITILES[CONSUMERS_COLUMNS_IDS.READ_LAGS]}
18+
content={
1919
<div className={b('lags-popover-content')}>
2020
<div>{i18n('lagsPopover.readLags')}</div>
2121
<div>

src/containers/Tenant/Diagnostics/Partitions/Headers/Headers.tsx

Lines changed: 8 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,8 @@ export const ReadSessionHeader = () => (
2828
export const WriteLagsHeader = () => (
2929
<LabelWithPopover
3030
className={b('lags')}
31-
headerText={PARTITIONS_COLUMNS_TITILES[PARTITIONS_COLUMNS_IDS.READ_LAGS]}
32-
popoverContent={
31+
text={PARTITIONS_COLUMNS_TITILES[PARTITIONS_COLUMNS_IDS.READ_LAGS]}
32+
content={
3333
<div className={b('lags-popover-content')}>
3434
<div>{i18n('lagsPopover.writeLags')}</div>
3535
<div>
@@ -43,8 +43,8 @@ export const WriteLagsHeader = () => (
4343
export const ReadLagsHeader = () => (
4444
<LabelWithPopover
4545
className={b('lags')}
46-
headerText={PARTITIONS_COLUMNS_TITILES[PARTITIONS_COLUMNS_IDS.WRITE_LAGS]}
47-
popoverContent={
46+
text={PARTITIONS_COLUMNS_TITILES[PARTITIONS_COLUMNS_IDS.WRITE_LAGS]}
47+
content={
4848
<div className={b('lags-popover-content')}>
4949
<div>{i18n('lagsPopover.readLags')}</div>
5050
<div>
@@ -58,19 +58,15 @@ export const ReadLagsHeader = () => (
5858
export const UnreadMessagesHeader = () => (
5959
<LabelWithPopover
6060
className={b('messages')}
61-
headerText={PARTITIONS_COLUMNS_TITILES[PARTITIONS_COLUMNS_IDS.UNREAD_MESSAGES]}
62-
popoverContent={
63-
<div className={b('messages-popover-content')}>{i18n('headers.unread')}</div>
64-
}
61+
text={PARTITIONS_COLUMNS_TITILES[PARTITIONS_COLUMNS_IDS.UNREAD_MESSAGES]}
62+
content={<div className={b('messages-popover-content')}>{i18n('headers.unread')}</div>}
6563
/>
6664
);
6765

6866
export const UncommitedMessagesHeader = () => (
6967
<LabelWithPopover
7068
className={b('messages')}
71-
headerText={PARTITIONS_COLUMNS_TITILES[PARTITIONS_COLUMNS_IDS.UNCOMMITED_MESSAGES]}
72-
popoverContent={
73-
<div className={b('messages-popover-content')}>{i18n('headers.uncommited')}</div>
74-
}
69+
text={PARTITIONS_COLUMNS_TITILES[PARTITIONS_COLUMNS_IDS.UNCOMMITED_MESSAGES]}
70+
content={<div className={b('messages-popover-content')}>{i18n('headers.uncommited')}</div>}
7571
/>
7672
);

0 commit comments

Comments
 (0)