fileSize.tsx 419 B

123456789101112131415161718192021
  1. import React from 'react';
  2. import {formatBytesBase2} from 'app/utils';
  3. import getDynamicText from 'app/utils/getDynamicText';
  4. type Props = {
  5. className?: string;
  6. bytes: number;
  7. };
  8. function FileSize(props: Props) {
  9. const {className, bytes} = props;
  10. return (
  11. <span className={className}>
  12. {getDynamicText({value: formatBytesBase2(bytes), fixed: 'xx KB'})}
  13. </span>
  14. );
  15. }
  16. export default FileSize;