17 lines
366 B
TypeScript
17 lines
366 B
TypeScript
import React, { FC } from "react";
|
|
import Link, { LinkProps } from "next/link";
|
|
|
|
type Props = {
|
|
isDisabled?: boolean;
|
|
} & React.PropsWithChildren<LinkProps>;
|
|
|
|
const NextLink: FC<Props> = ({ children, isDisabled = false, ...props }) => {
|
|
if (isDisabled) {
|
|
return <>{children}</>;
|
|
}
|
|
|
|
return <Link {...props}>{children}</Link>;
|
|
};
|
|
|
|
export default NextLink;
|