import { Center, Space, Title } from '@mantine/core'
import { IconCircleCheck, IconAlertCircle } from '@tabler/icons-react'
export default function OverallStatus({ state }: { state: { overallUp: number, overallDown: number, lastUpdate: number }}) {
let statusString = ''
let icon =
if (state.overallUp === 0 && state.overallDown === 0) {
statusString = 'No data yet'
} else if (state.overallUp === 0) {
statusString = 'All down'
} else if (state.overallDown === 0) {
statusString = 'All up'
icon =
} else {
statusString = `${state.overallUp} up, ${state.overallDown} down`
}
return (<>
{icon}
{statusString}
Last updated on: {new Date(state.lastUpdate * 1000).toLocaleString()}
>)
}