import React from 'react' ; import { EuiTitle } from '@elastic/eui' ; import { AggRow } from './agg_row' ; import type { Metric } from '../../../../common/types' ; import { DragHandleProps } from '../../../types' ; interface InvalidAggProps { disableDelete : boolean ; model : Metric ; siblings : Metric [ ] ; dragHandleProps : DragHandleProps ; onAdd : ( ) => void ; onDelete : ( ) => void ; } export const getInvalidAggComponent = ( message ) => ( props ) => { return ( < AggRow disableDelete = { props . disableDelete } model = { props . model } onAdd = { props . onAdd } onDelete = { props . onDelete } siblings = { props . siblings } dragHandleProps = { props . dragHandleProps } > < EuiTitle className = "tvbAggRow__unavailable" size = "xxxs" data - test - subj = "invalid_agg" > < span > { message } < /span> < /EuiTitle> < /AggRow>); } ;