Files
status/components/Header.tsx
T
Bennet Galleinandlyc8503 a6c8eb6e12 maintenance mode (#101)
* feat: move types

* feat: add maintenance alert

* feat: move to config/base class to have fallback values on missing exports

* fix: wrong import for types

* Revert "fix: wrong import for types"

This reverts commit ca2b2e3a68464cfa1b4aef4d99978de02591df74.

* Revert "feat: move to config/base class to have fallback values on missing exports"

This reverts commit 9932ea2590193aabd248fbba6b2c3a215da45d18.

* fix: imports

* chore: formatting

* fix: handle filtering for global status

* fix: pass props

* fix: ignore active maintenances when sending notifications

* fix: mark as warning when monitor is in maintenance

* fix: title width & warning icon

* fix: remove accordeons again

* alert config/style changes, worker code improve

* update example config

* update example config

* set monitors to be optional

---------

Co-authored-by: lyc8503 <[email protected]>
2025-05-01 01:09:53 +08:00

52 lines
1.3 KiB
TypeScript

import { Container, Group, Text } from '@mantine/core'
import classes from '@/styles/Header.module.css'
import { pageConfig } from '@/uptime.config'
import { PageConfigLink } from '@/types/config'
export default function Header() {
const linkToElement = (link: PageConfigLink) => {
return (
<a
key={link.label}
href={link.link}
target="_blank"
className={classes.link}
data-active={link.highlight}
>
{link.label}
</a>
)
}
return (
<header className={classes.header}>
<Container size="md" className={classes.inner}>
<div>
<a href="https://github.com/lyc8503/UptimeFlare" target="_blank">
<Text size="xl" span>
🕒
</Text>
<Text
size="xl"
span
fw={700}
variant="gradient"
gradient={{ from: 'blue', to: 'cyan', deg: 90 }}
>
UptimeFlare
</Text>
</a>
</div>
<Group gap={5} visibleFrom="sm">
{pageConfig.links?.map(linkToElement)}
</Group>
<Group gap={5} hiddenFrom="sm">
{pageConfig.links?.filter((link) => link.highlight).map(linkToElement)}
</Group>
</Container>
</header>
)
}