import { useTranslate } from 'i18n-calypso'; import { PerformanceMetricsDetailsQueryResponse } from 'calypso/data/site-profiler/types'; import { getFormattedNumber, getFormattedSize } from 'calypso/site-profiler/utils/formatting-data'; interface InsightTreeProps { data: PerformanceMetricsDetailsQueryResponse; } export const InsightTree: React.FC< InsightTreeProps > = ( { data } ) => { const translate = useTranslate(); const chains: { [ key: string ]: any } = data?.chains ?? {}; return Object.keys( chains ).map( ( item: string, index ) => { const request = chains[ item ]; const children = chains[ item ][ 'children' ]; return (