mirror of
https://github.com/CompassConnections/Compass.git
synced 2026-03-25 10:02:27 -04:00
* Test * Add pretty formatting * Fix Tests * Fix Tests * Fix Tests * Fix * Add pretty formatting fix * Fix * Test * Fix tests * Clean typeckech * Add prettier check * Fix api tsconfig * Fix api tsconfig * Fix tsconfig * Fix * Fix * Prettier
18 lines
433 B
TypeScript
18 lines
433 B
TypeScript
import Link from 'next/link'
|
|
|
|
export const CustomLink = ({href, children}: {href?: string; children: React.ReactNode}) => {
|
|
if (!href) return <>{children}</>
|
|
|
|
// If href is internal, use Next.js Link
|
|
if (href.startsWith('/')) {
|
|
return <Link href={href}>{children}</Link>
|
|
}
|
|
|
|
// For external links, fall back to <a>
|
|
return (
|
|
<a href={href} target="_blank" rel="noopener noreferrer">
|
|
{children}
|
|
</a>
|
|
)
|
|
}
|