import React , { ReactNode } from 'react' ; import { onlyText } from 'react-children-utilities' ; import flatMap from 'lodash/flatMap' ; param children returns export default function getPipelineCounterTooltip ( children ) { const stages = ( React . Children . map ( children , onlyText ) || [ ] ) . filter ( Boolean ) ; return flatMap ( stages , ( value , index , array ) => array . length - 1 !== index ? [ value , '>' ] : value ) . join ( ' ' ) ; }