(props?: LinkDOMProps)
| 204 | } |
| 205 | |
| 206 | export function useLinkProps(props?: LinkDOMProps): LinkDOMProps { |
| 207 | let router = useRouter(); |
| 208 | // oxlint-disable-next-line react/react-compiler |
| 209 | const href = router.useHref(props?.href ?? ''); |
| 210 | let linkProps: LinkDOMProps = {}; |
| 211 | if (props) { |
| 212 | for (let key of ['href', 'target', 'rel', 'download', 'ping', 'referrerPolicy']) { |
| 213 | if (key in props && props[key] !== undefined) { |
| 214 | linkProps[key] = key === 'href' ? href : props[key]; |
| 215 | } |
| 216 | } |
| 217 | } |
| 218 | return linkProps; |
| 219 | } |
| 220 | |
| 221 | export function handleLinkClick( |
| 222 | e: ReactMouseEvent, |
no test coverage detected