import type {TPoolStats} from '../../types/api/nodes'; import {cn} from '../../utils/cn'; import './PoolUsage.scss'; const b = cn('ydb-pool-usage'); const getLineType = (fillWidth: number) => { let fillColor = 'green'; if (fillWidth > 60 && fillWidth <= 80) { fillColor = 'yellow'; } else if (fillWidth > 80) { fillColor = 'red'; } return fillColor; }; interface PoolUsageProps { data?: TPoolStats; } export const PoolUsage = ({data: pool = {}}: PoolUsageProps) => { const {Threads, Name = 'Unknown', Usage = 0} = pool; const dataExist = Usage && Threads; const value = Math.floor(Usage * 100); const fillWidth = value > 100 ? 100 : value; return (