@@ -2,7 +2,6 @@ import React from "react";
2
2
import { IncidentCountsModel , IncidentSeverityLevelCountsModel , TopIncidentsModel } from "../../../api" ;
3
3
import SectionWrapper from "../../../components/Dashboard/SectionWrapper" ;
4
4
import moment from 'moment' ;
5
- import Button from "../../../components/Button" ;
6
5
import { ROUTES } from "../../../shared/routes" ;
7
6
import { useHistory } from 'react-router-dom' ;
8
7
@@ -16,7 +15,7 @@ export default function Gauge({
16
15
incidentCounts : IncidentCountsModel | undefined ,
17
16
colorClassName : string ,
18
17
title : string ,
19
- severity : string ,
18
+ severity : number ,
20
19
status : string
21
20
} ) {
22
21
const history = useHistory ( ) ;
@@ -26,28 +25,27 @@ export default function Gauge({
26
25
return formattedDate ;
27
26
}
28
27
29
- const goToIncidents = ( severity : string , status : string ) => {
28
+ const goToIncidents = ( severity : number , status : string ) => {
30
29
history . push (
31
30
ROUTES . INCIDENT_CONNECTION (
32
- `*?severity=${ severity } &status= ${ status } `
31
+ `*?severity=${ severity } &${ status } =true `
33
32
)
34
33
) ;
35
34
} ;
36
35
37
36
return (
38
- < SectionWrapper
39
- className = { "flex justify-center border-2 my-4 mx-4 lg:mx-10 xl:mx-14 2xl:mx-4 screen1900:mx-14 screen3000:mx-34 " + colorClassName }
40
- title = { title }
41
- // titleIcon={<div className={"w-4 h-4 border " + colorClassName}></div>}
42
- >
43
- < div
44
- className = "w-[150px]"
37
+ < div className = { "flex flex-col justify-center mx-1 lg:mx-4 lg:my-2 pb-2 cursor-pointer border-2 " + colorClassName } >
38
+ < div
39
+ className = "w-full min-w-[110px] max-w-[160px] mx-auto"
45
40
onClick = { ( ) => goToIncidents ( severity , status ) }
46
41
>
47
- < div className = "text-center pt-1 pb-3 text-2xl " >
42
+ < div className = "text-center pt-1 text-2xl w-full " >
48
43
{ incidentCounts ?. currentMonthCount && incidentCounts ?. previousMonthCount && incidentCounts ?. currentMonthCount + incidentCounts ?. previousMonthCount }
49
44
</ div >
50
- < div className = "flex justify-between text-xs px-5" >
45
+ < div className = "text-center pb-3 text-2xl text-xs" >
46
+ { title }
47
+ </ div >
48
+ < div className = "flex justify-between text-xs px-1" >
51
49
< div className = "" >
52
50
Last 24h
53
51
</ div >
@@ -57,7 +55,7 @@ export default function Gauge({
57
55
{ incidentCounts ?. countFromLast24h }
58
56
</ div >
59
57
</ div >
60
- < div className = "flex justify-between text-xs px-5 " >
58
+ < div className = "flex justify-between text-xs px-1 " >
61
59
< div className = "" >
62
60
Last 7 days
63
61
</ div >
@@ -67,7 +65,7 @@ export default function Gauge({
67
65
{ incidentCounts ?. countFromLast7days }
68
66
</ div >
69
67
</ div >
70
- < div className = "flex justify-between text-xs px-5 " >
68
+ < div className = "flex justify-between text-xs px-1 " >
71
69
< div className = "" >
72
70
{ incidentCounts ?. currentMonthDate && getMonthName ( incidentCounts ?. currentMonthDate ) }
73
71
</ div >
@@ -77,7 +75,7 @@ export default function Gauge({
77
75
{ incidentCounts ?. currentMonthCount }
78
76
</ div >
79
77
</ div >
80
- < div className = "flex justify-between text-xs px-5 " >
78
+ < div className = "flex justify-between text-xs px-1 " >
81
79
< div className = "" >
82
80
{ incidentCounts ?. previousMonthDate && getMonthName ( incidentCounts ?. previousMonthDate ) }
83
81
</ div >
@@ -88,7 +86,7 @@ export default function Gauge({
88
86
</ div >
89
87
</ div >
90
88
</ div >
91
- </ SectionWrapper >
89
+ </ div >
92
90
) ;
93
91
94
92
}
0 commit comments