/
githubmirror
/
ydb-embedded-ui
Обзор
Документация
Войти
/
githubmirror
/
ydb-embedded-ui
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
main
src/components/FormattedBytes/FormattedBytes.tsx
12 строк
530 B
Hellen
fix(ClusterMetricsCores): format value and capacity same way (#1532)
28 окт 2024, 16:15
Не верифицирован
28 окт 2024, 16:15
4eb5c04
Код
Авторство
О чём код?
import type {BytesSizes} from '../../utils/bytesParsers'; import {formatBytes} from '../../utils/bytesParsers'; import type {FormatValuesArgs} from '../../utils/dataFormatters/common'; type FormattedBytesProps = FormatValuesArgs<BytesSizes>; export const FormattedBytes = ({value, withSpeedLabel, ...params}: FormattedBytesProps) => { const formatted = formatBytes({value, withSpeedLabel, ...params}); const bytes = formatBytes({value, withSpeedLabel, size: 'b'}); return <span title={bytes}>{formatted}</span>; };