1
1
// Components
2
- import { Stack , Typography , Skeleton } from "@mui/material" ;
2
+ import { Stack , Typography } from "@mui/material" ;
3
3
import Breadcrumbs from "../../../Components/Breadcrumbs" ;
4
+ import MonitorTimeFrameHeader from "../../../Components/MonitorTimeFrameHeader" ;
4
5
import MonitorStatusHeader from "../../../Components/MonitorStatusHeader" ;
5
6
import PageSpeedStatusBoxes from "./Components/PageSpeedStatusBoxes" ;
6
7
import PageSpeedAreaChart from "./Components/PageSpeedAreaChart" ;
7
8
import PerformanceReport from "./Components/PerformanceReport" ;
9
+ import GenericFallback from "../../../Components/GenericFallback" ;
8
10
// Utils
9
11
import { useTheme } from "@emotion/react" ;
10
12
import { useIsAdmin } from "../../../Hooks/useIsAdmin" ;
@@ -41,10 +43,28 @@ const PageSpeedDetails = () => {
41
43
setMetrics ( ( prev ) => ( { ...prev , [ id ] : ! prev [ id ] } ) ) ;
42
44
} ;
43
45
46
+ // Empty view, displayed when loading is complete and there are no checks
47
+ if ( ! isLoading && monitor ?. checks ?. length === 0 ) {
48
+ return (
49
+ < Stack gap = { theme . spacing ( 10 ) } >
50
+ < Breadcrumbs list = { BREADCRUMBS } />
51
+ < MonitorStatusHeader
52
+ path = { "pagespeed" }
53
+ isAdmin = { isAdmin }
54
+ monitor = { monitor }
55
+ />
56
+ < GenericFallback >
57
+ < Typography > There is no history for this monitor yet.</ Typography >
58
+ </ GenericFallback >
59
+ </ Stack >
60
+ ) ;
61
+ }
62
+
44
63
return (
45
64
< Stack gap = { theme . spacing ( 10 ) } >
46
65
< Breadcrumbs list = { BREADCRUMBS } />
47
66
< MonitorStatusHeader
67
+ path = { "pagespeed" }
48
68
isAdmin = { isAdmin }
49
69
shouldRender = { ! isLoading }
50
70
monitor = { monitor }
@@ -53,12 +73,12 @@ const PageSpeedDetails = () => {
53
73
shouldRender = { ! isLoading }
54
74
monitor = { monitor }
55
75
/>
56
- < Typography
57
- variant = "body2"
58
- my = { theme . spacing ( 8 ) }
59
- >
60
- Showing statistics for past 24 hours.
61
- </ Typography >
76
+ < MonitorTimeFrameHeader
77
+ shouldRender = { ! isLoading }
78
+ dateRange = { "day" }
79
+ hasDateRange = { false }
80
+ />
81
+
62
82
< PageSpeedAreaChart
63
83
shouldRender = { ! isLoading }
64
84
monitor = { monitor }
0 commit comments