use anchor tag for system table links

This commit is contained in:
henrygd
2025-08-21 18:44:38 -04:00
parent 7ba1f366ba
commit 9d25181d1d
4 changed files with 39 additions and 33 deletions

View File

@@ -35,18 +35,15 @@ export const navigate = (urlString: string) => {
$router.open(urlString)
}
function onClick(e: React.MouseEvent<HTMLAnchorElement, MouseEvent>) {
e.preventDefault()
$router.open(new URL((e.currentTarget as HTMLAnchorElement).href).pathname)
}
export const Link = (props: React.AnchorHTMLAttributes<HTMLAnchorElement>) => {
let clickFn = onClick
if (props.onClick) {
clickFn = (e) => {
onClick(e)
props.onClick?.(e)
}
}
return <a {...props} onClick={clickFn}></a>
export function Link(props: React.AnchorHTMLAttributes<HTMLAnchorElement>) {
return (
<a
{...props}
onClick={(e) => {
e.preventDefault()
$router.open(new URL((e.currentTarget as HTMLAnchorElement).href).pathname)
props.onClick?.(e)
}}
></a>
)
}