import React, { type ElementType } from 'react'; import { Link as _Link, useInRouterContext } from 'react-router'; import type { AsProps } from './props'; export type LinkProps = AsProps & { as?: E; href: string; }; export const Link = ({ as: As = 'a', ...props }: LinkProps) => { if (useInRouterContext()) { return <_Link to={props.href} {...props} />; } // if (useIsNextJS()) { // return ; // } return ; };