import Link from 'next/link' import { useRouter } from 'next/router' import GitHub from './GitHub' import { LineChart } from './LineChart' import ThemeSwitcher from './ThemeSwitcher' type HeaderProps = { name: string darkMode: boolean setDarkMode: (state: boolean) => void searchIndex: SearchIndex } import * as React from 'react' import Search from './Search' import { SearchIndex } from '../utils/search' interface NavLinkProps { href: string name: string } const NavLink: React.FunctionComponent = (props) => { const router = useRouter() const bg = router.asPath.startsWith(props.href) ? 'bg-rose-100 dark:bg-rose-900' : '' return ( {props.name} ) } export default function Header({ name, darkMode, setDarkMode, searchIndex, }: HeaderProps) { const router = useRouter() return (

{name}

{router.asPath != '/' && (
)}
) }