mirror of
https://github.com/blitzkit/blitzkit.git
synced 2026-10-21 10:47:04 +02:00
21 lines
427 B
TypeScript
21 lines
427 B
TypeScript
'use client';
|
|
|
|
import { LinkProps, Link as RadixLink } from '@radix-ui/themes';
|
|
import { useRouter } from 'next/navigation';
|
|
|
|
export function Link({ href, onClick, ...props }: LinkProps) {
|
|
const router = useRouter();
|
|
|
|
return (
|
|
<RadixLink
|
|
href={href}
|
|
onClick={(event) => {
|
|
event.preventDefault();
|
|
if (href) router.push(href);
|
|
onClick?.(event);
|
|
}}
|
|
{...props}
|
|
/>
|
|
);
|
|
}
|