1
+ import styled from '@emotion/styled' ;
2
+
1
3
import { Tooltip } from 'sentry/components/core/tooltip' ;
2
4
import Count from 'sentry/components/count' ;
3
5
import { t , tct } from 'sentry/locale' ;
@@ -22,6 +24,7 @@ export function ConfidenceFooter({
22
24
return (
23
25
< Container >
24
26
< ConfidenceMessage
27
+ isLoading = { isLoading }
25
28
confidence = { chartInfo . confidence }
26
29
dataScanned = { chartInfo . dataScanned }
27
30
isSampled = { chartInfo . isSampled }
@@ -33,6 +36,7 @@ export function ConfidenceFooter({
33
36
}
34
37
35
38
interface ConfidenceMessageProps {
39
+ isLoading : boolean ;
36
40
confidence ?: Confidence ;
37
41
dataScanned ?: 'full' | 'partial' ;
38
42
isSampled ?: boolean | null ;
@@ -45,14 +49,13 @@ function ConfidenceMessage({
45
49
dataScanned,
46
50
confidence,
47
51
topEvents,
52
+ isLoading,
48
53
isSampled,
49
54
} : ConfidenceMessageProps ) {
50
55
const isTopN = defined ( topEvents ) && topEvents > 1 ;
51
56
52
- if ( ! defined ( sampleCount ) ) {
53
- return isTopN
54
- ? t ( '* Top %s groups extrapolated based on \u2026' , topEvents )
55
- : t ( '* Extrapolated based on \u2026' ) ;
57
+ if ( ! defined ( sampleCount ) || isLoading ) {
58
+ return < Placeholder /> ;
56
59
}
57
60
58
61
const noSampling = defined ( isSampled ) && ! isSampled ;
@@ -62,13 +65,13 @@ function ConfidenceMessage({
62
65
// For logs, if the full data was scanned, we can assume that no
63
66
// extrapolation happened and we should remove mentions of extrapolation.
64
67
if ( isTopN ) {
65
- return tct ( 'Top [topEvents] groups based on [sampleCountComponent] logs ' , {
68
+ return tct ( 'Log count for top [topEvents] groups: [sampleCountComponent]' , {
66
69
topEvents,
67
70
sampleCountComponent,
68
71
} ) ;
69
72
}
70
73
71
- return tct ( 'Based on [sampleCountComponent] logs ' , {
74
+ return tct ( 'Log count: [sampleCountComponent]' , {
72
75
sampleCountComponent,
73
76
} ) ;
74
77
}
@@ -142,3 +145,10 @@ function LowAccuracyFullTooltip({
142
145
</ Tooltip >
143
146
) ;
144
147
}
148
+
149
+ const Placeholder = styled ( 'div' ) `
150
+ width: 180px;
151
+ height: ${ p => p . theme . fontSize . md } ;
152
+ border-radius: ${ p => p . theme . borderRadius } ;
153
+ background-color: ${ p => p . theme . backgroundTertiary } ;
154
+ ` ;
0 commit comments