import classNames from "classnames";
import { NavLink, NavLinkProps } from "react-router-dom";

type Props = {
  enabled?: boolean;
  children?: React.ReactNode;
} & NavLinkProps;

export function RouterLink({ children, enabled = true, className, to }: Props) {
  return (
    <NavLink
      to={to}
      className={classNames({ "pointer-events-none": !enabled }, className)}
    >
      {children}
    </NavLink>
  );
}
