format code and no semi

This commit is contained in:
lyc8503 committed 2023-11-06 00:51:41 +08:00
1 parent eba65bd654
commit 87611700c3
11 files changed
+135 -157

No files matched your search

+3 -11
View File
@@ -7,18 +7,14 @@ export default function OverallStatus({
state: { overallUp: number; overallDown: number; lastUpdate: number }
}) {
let statusString = ''
let icon = (
<IconAlertCircle style={{ width: 64, height: 64, color: '#b91c1c' }} />
)
let icon = <IconAlertCircle style={{ width: 64, height: 64, color: '#b91c1c' }} />
if (state.overallUp === 0 && state.overallDown === 0) {
statusString = 'No data yet'
} else if (state.overallUp === 0) {
statusString = 'All systems not operational'
} else if (state.overallDown === 0) {
statusString = 'All systems operational'
icon = (
<IconCircleCheck style={{ width: 64, height: 64, color: '#059669' }} />
)
icon = <IconCircleCheck style={{ width: 64, height: 64, color: '#059669' }} />
} else {
statusString = `Some systems not operational (${state.overallDown} out of ${
state.overallUp + state.overallDown
@@ -31,11 +27,7 @@ export default function OverallStatus({
<Title mt="sm" style={{ textAlign: 'center' }} order={1}>
{statusString}
</Title>
<Title
mt="sm"
style={{ textAlign: 'center', color: '#70778c' }}
order={5}
>
<Title mt="sm" style={{ textAlign: 'center', color: '#70778c' }} order={5}>
Last updated on:{' '}
{`${new Date(state.lastUpdate * 1000).toLocaleString()} (${
Math.round(Date.now() / 1000) - state.lastUpdate