2022-08-16 00:01:54 +02:00
|
|
|
import { ReactNode } from "react";
|
|
|
|
import Link from "next/link";
|
|
|
|
|
|
|
|
export interface Props {
|
|
|
|
children?: ReactNode | undefined;
|
|
|
|
href: string;
|
|
|
|
plain?: boolean | undefined; // Do not wrap in <li></li>
|
|
|
|
}
|
|
|
|
|
|
|
|
export default function NavItem(props: Props) {
|
|
|
|
const ret = (
|
2022-11-19 16:52:52 +01:00
|
|
|
<Link
|
|
|
|
href={props.href}
|
|
|
|
className="hover:text-sky-500 dark:hover:text-sky-400"
|
|
|
|
>
|
|
|
|
{props.children}
|
2022-08-16 00:01:54 +02:00
|
|
|
</Link>
|
|
|
|
);
|
|
|
|
|
|
|
|
if (props.plain) {
|
|
|
|
return ret;
|
|
|
|
}
|
|
|
|
return <li>{ret}</li>;
|
|
|
|
}
|