@ -1,8 +1,6 @@
import { css } from '@emotion/css' ;
import React , { useEffect } from 'react' ;
import { GrafanaTheme2 } from '@grafana/data' ;
import { Alert , LoadingPlaceholder , useStyles2 } from '@grafana/ui' ;
import { Alert , LoadingPlaceholder , Text , Box } from '@grafana/ui' ;
import { useQueryParams } from 'app/core/hooks/useQueryParams' ;
import { useDispatch } from 'app/types' ;
@ -29,7 +27,6 @@ const AlertGroups = () => {
const dispatch = useDispatch ( ) ;
const [ queryParams ] = useQueryParams ( ) ;
const { groupBy = [ ] } = getFiltersFromUrlParams ( queryParams ) ;
const styles = useStyles2 ( getStyles ) ;
const { currentData : amConfigStatus } = useGetAlertmanagerChoiceStatusQuery ( ) ;
@ -79,7 +76,11 @@ const AlertGroups = () => {
< React.Fragment key = { ` ${ JSON . stringify ( group . labels ) } -group- ${ index } ` } >
{ ( ( index === 1 && Object . keys ( filteredAlertGroups [ 0 ] . labels ) . length === 0 ) ||
( index === 0 && Object . keys ( group . labels ) . length > 0 ) ) && (
< p className = { styles . groupingBanner } > Grouped by : { Object . keys ( group . labels ) . join ( ', ' ) } < / p >
< Box paddingY = { 2 } >
< Text element = "h2" variant = "body" >
Grouped by : { Object . keys ( group . labels ) . join ( ', ' ) }
< / Text >
< / Box >
) }
< AlertGroup alertManagerSourceName = { selectedAlertmanager || '' } group = { group } / >
< / React.Fragment >
@ -96,10 +97,4 @@ const AlertGroupsPage = () => (
< / AlertmanagerPageWrapper >
) ;
const getStyles = ( theme : GrafanaTheme2 ) = > ( {
groupingBanner : css `
margin : $ { theme . spacing ( 2 , 0 ) } ;
` ,
} ) ;
export default AlertGroupsPage ;