@premieroctet/next-admin
Version:
Next-Admin provides a customizable and turnkey admin dashboard for applications built with Next.js and powered by the Prisma ORM. It aims to simplify the development process by providing a turnkey admin system that can be easily integrated into your proje
24 lines (23 loc) • 717 B
JavaScript
import { jsx } from "react/jsx-runtime";
import { useRouterInternal } from "../../hooks/useRouterInternal.mjs";
const Link = ({ children, onClick, ...props })=>{
const { router } = useRouterInternal();
return /*#__PURE__*/ jsx("a", {
onClick: (e)=>{
e.persist();
onClick?.(e);
if ("_blank" === e.target.target) {
e.preventDefault();
window.open(props.href, "_blank");
}
if (e.defaultPrevented) return;
router.push({
pathname: props.href
});
},
...props,
children: children
});
};
const common_Link = Link;
export { common_Link as default };