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

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

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