This repository has been archived on 2024-10-29. You can view files and clone it, but cannot push or open issues or pull requests.
scoresaber-reloadedv3/src/components/fallback-link.tsx
Liam 574b1a6532
All checks were successful
Deploy SSR / deploy (push) Successful in 1m13s
move logging to debug and make mappers clickable on the score
2024-09-12 15:02:03 +01:00

24 lines
385 B
TypeScript

import NextLink from "next/link";
type Props = {
/**
* The link to open in a new tab.
*/
href?: string;
/**
* The children to render.
*/
children: React.ReactNode;
};
export default function FallbackLink({ href, children }: Props) {
return href ? (
<NextLink href={href} target="_blank">
{children}
</NextLink>
) : (
<>{children}</>
);
}