SizeCell.tsx 548 B

1234567891011121314151617
  1. import React from 'react';
  2. import { CellContext } from '@tanstack/react-table';
  3. import BytesFormatted from 'components/common/BytesFormatted/BytesFormatted';
  4. // eslint-disable-next-line @typescript-eslint/no-explicit-any
  5. type AsAny = any;
  6. const SizeCell: React.FC<
  7. CellContext<AsAny, unknown> & { renderSegments?: boolean }
  8. > = ({ getValue, row, renderSegments = false }) => (
  9. <>
  10. <BytesFormatted value={getValue<string | number>()} />
  11. {renderSegments ? `, ${row?.original.count} segment(s)` : null}
  12. </>
  13. );
  14. export default SizeCell;