kafka-ui/kafka-ui-react-app/src/components/common/NewTable/SizeCell.tsx
2023-05-08 12:33:58 +04:00

17 lines
548 B
TypeScript

import React from 'react';
import { CellContext } from '@tanstack/react-table';
import BytesFormatted from 'components/common/BytesFormatted/BytesFormatted';
// eslint-disable-next-line @typescript-eslint/no-explicit-any
type AsAny = any;
const SizeCell: React.FC<
CellContext<AsAny, unknown> & { renderSegments?: boolean }
> = ({ getValue, row, renderSegments = false }) => (
<>
<BytesFormatted value={getValue<string | number>()} />
{renderSegments ? `, ${row?.original.count} segment(s)` : null}
</>
);
export default SizeCell;