1
- import Box from "@mui/material/Box" ;
2
- import { Theme } from "@mui/material/styles" ;
3
- import useTheme from "@mui/styles/useTheme" ;
4
1
import {
5
2
CategoryScale ,
6
3
Chart as ChartJS ,
@@ -22,7 +19,8 @@ import {
22
19
HelpTooltipText ,
23
20
} from "components/HelpTooltip/HelpTooltip" ;
24
21
import dayjs from "dayjs" ;
25
- import { FC } from "react" ;
22
+ import { useTheme } from "@emotion/react" ;
23
+ import { type FC } from "react" ;
26
24
import { Line } from "react-chartjs-2" ;
27
25
import annotationPlugin from "chartjs-plugin-annotation" ;
28
26
@@ -42,7 +40,7 @@ ChartJS.register(
42
40
const USER_LIMIT_DISPLAY_THRESHOLD = 60 ;
43
41
44
42
export interface ActiveUserChartProps {
45
- data : { date : string ; amount : number } [ ] ;
43
+ data : Array < { date : string ; amount : number } > ;
46
44
interval : "day" | "week" ;
47
45
userLimit : number | undefined ;
48
46
}
@@ -52,7 +50,7 @@ export const ActiveUserChart: FC<ActiveUserChartProps> = ({
52
50
interval,
53
51
userLimit,
54
52
} ) => {
55
- const theme : Theme = useTheme ( ) ;
53
+ const theme = useTheme ( ) ;
56
54
57
55
const labels = data . map ( ( val ) => dayjs ( val . date ) . format ( "YYYY-MM-DD" ) ) ;
58
56
const chartData = data . map ( ( val ) => val . amount ) ;
@@ -137,9 +135,9 @@ export const ActiveUserChart: FC<ActiveUserChartProps> = ({
137
135
) ;
138
136
} ;
139
137
140
- export const ActiveUsersTitle = ( ) => {
138
+ export const ActiveUsersTitle : FC = ( ) => {
141
139
return (
142
- < Box sx = { { display : "flex" , alignItems : "center" , gap : 1 } } >
140
+ < div css = { { display : "flex" , alignItems : "center" , gap : 8 } } >
143
141
Active Users
144
142
< HelpTooltip size = "small" >
145
143
< HelpTooltipTitle > How do we calculate active users?</ HelpTooltipTitle >
@@ -148,7 +146,7 @@ export const ActiveUsersTitle = () => {
148
146
considered an active user. e.g. apps, web terminal, SSH
149
147
</ HelpTooltipText >
150
148
</ HelpTooltip >
151
- </ Box >
149
+ </ div >
152
150
) ;
153
151
} ;
154
152
0 commit comments