mirror of
https://github.com/supabase/supabase.git
synced 2026-10-16 22:59:11 +03:00
24 lines
609 B
TypeScript
24 lines
609 B
TypeScript
import Link from 'next/link'
|
|
import { PropsWithChildren } from 'react'
|
|
|
|
interface InlineLinkProps {
|
|
href: string
|
|
}
|
|
|
|
export const InlineLink = ({ href, children }: PropsWithChildren<InlineLinkProps>) => {
|
|
const className =
|
|
'underline transition underline-offset-2 decoration-foreground-lighter hover:decoration-foreground text-foreground'
|
|
if (href.startsWith('http')) {
|
|
return (
|
|
<a className={className} href={href} target="_blank" rel="noreferrer noopener">
|
|
{children}
|
|
</a>
|
|
)
|
|
}
|
|
return (
|
|
<Link className={className} href={href}>
|
|
{children}
|
|
</Link>
|
|
)
|
|
}
|