import { Container, Group, Image, Text } from '@mantine/core' import classes from '@/styles/Header.module.css' import { pageConfig } from '@/uptime.config' import { PageConfigLink } from '@/types/config' import { useTranslation } from 'react-i18next' export default function Header({ style }: { style?: React.CSSProperties }) { const { t } = useTranslation('common') const linkToElement = (link: PageConfigLink, i: number) => { return ( {link.label} ) } const links = [ ...(pageConfig.incidents !== false ? [{ label: t('Incidents'), link: '/incidents' }] : []), ...(pageConfig.links || []), ] const logoHref = location.pathname == '/' ? pageConfig.logoLink ?? 'https://github.com/lyc8503/UptimeFlare' : '/' return (
logo {pageConfig.showTitle && pageConfig.title && ( {pageConfig.title} )} {links?.map(linkToElement)} {links?.filter((link) => link.highlight || link.link.startsWith('/')).map(linkToElement)}
) }