import {InfoViewer} from '../../../../../components/InfoViewer/InfoViewer'; import {ProgressWrapper} from '../../../../../components/ProgressWrapper'; import {TENANT_DIAGNOSTICS_TABS_IDS} from '../../../../../store/reducers/tenant/constants'; import type {TMemoryStats} from '../../../../../types/api/nodes'; import {cn} from '../../../../../utils/cn'; import {EMPTY_DATA_PLACEHOLDER} from '../../../../../utils/constants'; import {formatStorageValuesToGb} from '../../../../../utils/dataFormatters/dataFormatters'; import {useDiagnosticsPageLinkGetter} from '../../DiagnosticsPages'; import {MetricPageSummary} from '../MetricPageSummary/MetricPageSummary'; import {StatsWrapper} from '../StatsWrapper/StatsWrapper'; import {TenantDashboard} from '../TenantDashboard/TenantDashboard'; import i18n from '../i18n'; import type {TenantOverviewUsageMetric} from '../metricOverview'; import {MemoryDetailsSection} from './MemoryDetailsSection'; import {TopNodesByMemory} from './TopNodesByMemory'; import {memoryDashboardConfig} from './memoryDashboardConfig'; import './TenantMemory.scss'; interface TenantMemoryProps { database: string; memoryStats?: TMemoryStats; memoryUsed?: string; memoryLimit?: string; metric?: TenantOverviewUsageMetric; } const b = cn('tenant-memory'); export function TenantMemory({ database, memoryStats, memoryUsed, memoryLimit, metric, }: TenantMemoryProps) { const getDiagnosticsPageLink = useDiagnosticsPageLinkGetter(); const renderMemoryDetails = () => { if (memoryStats) { return ; } // Simple fallback view return ( ), }, ]} /> ); }; return (
{metric ? ( ) : null} {renderMemoryDetails()}
); }