mirror of
https://github.com/tormachris/cf-workers-status-page.git
synced 2025-09-21 16:35:15 +02:00
init
This commit is contained in:
16
src/components/monitorStatusLabel.js
Normal file
16
src/components/monitorStatusLabel.js
Normal file
@ -0,0 +1,16 @@
|
||||
export default function MonitorStatusLabel({ kvMonitorsMap, monitor }) {
|
||||
let labelColor = 'grey'
|
||||
let labelText = 'No data'
|
||||
|
||||
if (typeof kvMonitorsMap[monitor.id] !== 'undefined') {
|
||||
if (kvMonitorsMap[monitor.id].operational) {
|
||||
labelColor = 'green'
|
||||
labelText = 'Operational'
|
||||
} else {
|
||||
labelColor = 'orange'
|
||||
labelText = 'Not great not terrible'
|
||||
}
|
||||
}
|
||||
|
||||
return <div className={`ui ${labelColor} horizontal label`}>{labelText}</div>
|
||||
}
|
Reference in New Issue
Block a user