1
1
import { Box , CircularProgress , CircularProgressProps , Typography , type BoxProps } from '@mui/material' ;
2
2
import React , { type ReactNode , type FC , type HTMLAttributes } from 'react' ;
3
3
4
+ import { useTheme2 } from '@grafana/ui' ;
5
+
4
6
import logoUrl from './fn-logo.svg' ;
5
7
6
8
export type FnLoaderProps = {
@@ -17,25 +19,32 @@ export const FnLoader: FC<FnLoaderProps> = ({
17
19
circularProgressProps,
18
20
imageProps,
19
21
text,
20
- } ) => (
21
- < Box
22
- display = "flex"
23
- justifyContent = "center"
24
- alignItems = "center"
25
- flexDirection = "column"
26
- paddingTop = "150px"
27
- { ...outerContainerProps }
28
- >
29
- < img src = { logoUrl } alt = { 'FluxNinja logo' } style = { { transform : 'scale(4)' } } { ...imageProps } />
30
- < Box marginTop = "100px" { ...innerContainerProps } >
31
- < CircularProgress
32
- role = "alert"
33
- aria-busy = "true"
34
- aria-label = "Loading..."
35
- disableShrink
36
- { ...circularProgressProps }
37
- />
22
+ } ) => {
23
+ const theme = useTheme2 ( ) ;
24
+
25
+ return (
26
+ < Box
27
+ display = "flex"
28
+ justifyContent = "center"
29
+ alignItems = "center"
30
+ flexDirection = "column"
31
+ paddingTop = "150px"
32
+ { ...outerContainerProps }
33
+ >
34
+ < img src = { logoUrl } alt = { 'FluxNinja logo' } style = { { transform : 'scale(4)' } } { ...imageProps } />
35
+ < Box marginTop = "100px" { ...innerContainerProps } >
36
+ < CircularProgress
37
+ role = "alert"
38
+ aria-busy = "true"
39
+ aria-label = "Loading..."
40
+ disableShrink
41
+ sx = { {
42
+ color : theme . colors . primary . main ,
43
+ } }
44
+ { ...circularProgressProps }
45
+ />
46
+ </ Box >
47
+ { typeof text === 'string' ? < Typography > { text } </ Typography > : text || null }
38
48
</ Box >
39
- { typeof text === 'string' ? < Typography > { text } </ Typography > : text || null }
40
- </ Box >
41
- ) ;
49
+ ) ;
50
+ } ;
0 commit comments