mirror of
https://github.com/jakejarvis/jarv.is.git
synced 2025-04-27 22:30:29 -04:00
25 lines
605 B
TypeScript
25 lines
605 B
TypeScript
import classNames from "classnames/bind";
|
|
import Link from "next/link";
|
|
import { ReactNode } from "react";
|
|
|
|
import styles from "./MenuLink.module.css";
|
|
const cx = classNames.bind(styles);
|
|
|
|
type MenuLinkProps = {
|
|
href: string;
|
|
icon: ReactNode;
|
|
text: string;
|
|
current?: boolean;
|
|
className?: string;
|
|
};
|
|
|
|
const MenuLink = ({ href, icon, text, current, className }: MenuLinkProps) => (
|
|
<Link href={href} prefetch={false}>
|
|
<a className={cx(styles.link, { current: !!current }, className)}>
|
|
{icon} <span className={styles.label}>{text}</span>
|
|
</a>
|
|
</Link>
|
|
);
|
|
|
|
export default MenuLink;
|