import Link from 'next/link' import { useRouter } from 'next/router' import GitHub from './GitHub' import ThemeSwitcher from './ThemeSwitcher' import * as React from 'react' import Search from './Search' type HeaderProps = { name: string setDarkMode: (state: boolean) => void } 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, setDarkMode }: HeaderProps) { const router = useRouter() return (

{name}

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