Skip to content

Commit

Permalink
feat(TopTables): add links to tables
Browse files Browse the repository at this point in the history
  • Loading branch information
krosy1337 committed Oct 19, 2023
1 parent 7a336e3 commit e30b753
Showing 1 changed file with 9 additions and 2 deletions.
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import {useDispatch} from 'react-redux';
import {useLocation} from 'react-router';
import cn from 'bem-cn-lite';

import DataTable, {Column} from '@gravity-ui/react-data-table';
Expand All @@ -17,6 +18,7 @@ import type {KeyValueRow} from '../../../../../types/api/query';
import {formatBytes, getSizeWithSignificantDigits} from '../../../../../utils/bytesParsers';
import {TableSkeleton} from '../../../../../components/TableSkeleton/TableSkeleton';
import {ResponseError} from '../../../../../components/Errors/ResponseError';
import {LinkToSchemaObject} from '../../../../../components/LinkToSchemaObject/LinkToSchemaObject';

import './TenantStorage.scss';

Expand All @@ -28,6 +30,7 @@ interface TopTablesProps {

export function TopTables({path}: TopTablesProps) {
const dispatch = useDispatch();
const location = useLocation();

const {autorefresh} = useTypedSelector((state) => state.schema);

Expand Down Expand Up @@ -68,11 +71,15 @@ export function TopTables({path}: TopTablesProps) {
name: 'Path',
sortable: false,
render: ({row}) => (
<div className={b('cell-with-popover-wrapper')}>
<LinkToSchemaObject
className={b('cell-with-popover-wrapper')}
path={row.Path as string}
location={location}
>
<Popover className={b('cell-with-popover')} content={row.Path}>
{row.Path}
</Popover>
</div>
</LinkToSchemaObject>
),
},
];
Expand Down

0 comments on commit e30b753

Please sign in to comment.