(props?: LinkDOMProps)
| 198 | } |
| 199 | |
| 200 | export function useLinkProps(props?: LinkDOMProps): LinkDOMProps { |
| 201 | let router = useRouter(); |
| 202 | const href = router.useHref(props?.href ?? ''); |
| 203 | let linkProps: LinkDOMProps = {}; |
| 204 | if (props) { |
| 205 | for (let key of ['href', 'target', 'rel', 'download', 'ping', 'referrerPolicy']) { |
| 206 | if (key in props) { |
| 207 | linkProps[key] = key === 'href' ? href : props[key]; |
| 208 | } |
| 209 | } |
| 210 | } |
| 211 | return linkProps; |
| 212 | } |
| 213 | |
| 214 | export function handleLinkClick( |
| 215 | e: ReactMouseEvent, |
no test coverage detected