import {DefinitionList} from '@gravity-ui/uikit'; import {CellWithPopover} from '../../components/CellWithPopover/CellWithPopover'; import {CopyableValue} from '../../components/CopyableValue/CopyableValue'; import type {PDiskData} from '../../store/reducers/pdisk/types'; import {cn} from '../../utils/cn'; import {getDiskLocationItems} from '../../utils/disks/diskInfo/getDiskLocationItems'; import './PDiskStorageDetails.scss'; const b = cn('ydb-pdisk-storage-details'); const LOCATION_IDS = ['datacenter', 'rack', 'fqdn', 'pdisk-path']; const FIELD_ORDER = [...LOCATION_IDS, 'node-id', 'pdisk-id']; export function PDiskStorageDetails({ data = {}, className, }: { data?: PDiskData; className?: string; }) { const items = getDiskLocationItems(data, { Host: data.NodeHost, Rack: data.NodeRack, DC: data.NodeDC, }); return (
{FIELD_ORDER.map((id) => { const item = items.find((entry) => entry.id === id); if (!item) { return null; } const copyText = item.copyText === undefined ? undefined : String(item.copyText); return ( {item.content} ); })}
); }