upstream #1
| @@ -1,16 +1,13 @@ | ||||
| /* eslint-disable jsx-a11y/anchor-has-content */ | ||||
| import Link from 'next/link' | ||||
| import { AnchorHTMLAttributes, DetailedHTMLProps } from 'react' | ||||
| import type { LinkProps } from 'next/link' | ||||
| import { AnchorHTMLAttributes } from 'react' | ||||
|  | ||||
| const CustomLink = async ({ | ||||
|   href, | ||||
|   ...rest | ||||
| }: DetailedHTMLProps<AnchorHTMLAttributes<HTMLAnchorElement>, HTMLAnchorElement>) => { | ||||
| const CustomLink = ({ href, ...rest }: LinkProps & AnchorHTMLAttributes<HTMLAnchorElement>) => { | ||||
|   const isInternalLink = href && href.startsWith('/') | ||||
|   const isAnchorLink = href && href.startsWith('#') | ||||
|  | ||||
|   if (isInternalLink) { | ||||
|     // @ts-ignore | ||||
|     return <Link href={href} {...rest} /> | ||||
|   } | ||||
|  | ||||
|   | ||||
		Reference in New Issue
	
	Block a user