Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 1 addition & 33 deletions src/components/TabletNameWrapper/TabletNameWrapper.tsx
Original file line number Diff line number Diff line change
@@ -1,13 +1,5 @@
import {DefinitionList} from '@gravity-ui/uikit';

import {getTabletPagePath} from '../../routes';
import {createTabletDeveloperUIHref} from '../../utils/developerUI/developerUI';
import {useIsUserAllowedToMakeChanges} from '../../utils/hooks/useIsUserAllowedToMakeChanges';
import {CellWithPopover} from '../CellWithPopover/CellWithPopover';
import {EntityStatus} from '../EntityStatus/EntityStatus';
import {LinkWithIcon} from '../LinkWithIcon/LinkWithIcon';

import i18n from './i18n';

interface TabletNameWrapperProps {
tabletId: string | number;
Expand All @@ -16,34 +8,10 @@ interface TabletNameWrapperProps {
}

export function TabletNameWrapper({tabletId, followerId, database}: TabletNameWrapperProps) {
const isUserAllowedToMakeChanges = useIsUserAllowedToMakeChanges();

const tabletPath = getTabletPagePath(tabletId, {database, followerId: followerId?.toString()});
const tabletName = `${tabletId}${followerId ? `.${followerId}` : ''}`;

return (
<CellWithPopover
disabled={!isUserAllowedToMakeChanges}
closeDelay={200}
content={
<DefinitionList responsive>
<DefinitionList.Item name={i18n('field_links')}>
<LinkWithIcon
title={i18n('context_developer-ui')}
url={createTabletDeveloperUIHref(tabletId)}
/>
</DefinitionList.Item>
</DefinitionList>
}
placement={['top', 'bottom']}
openDelay={0}
>
<EntityStatus
name={tabletName}
path={tabletPath}
hasClipboardButton
showStatus={false}
/>
</CellWithPopover>
<EntityStatus name={tabletName} path={tabletPath} hasClipboardButton showStatus={false} />
);
}
4 changes: 0 additions & 4 deletions src/components/TabletNameWrapper/i18n/en.json

This file was deleted.

7 changes: 0 additions & 7 deletions src/components/TabletNameWrapper/i18n/index.ts

This file was deleted.

Loading