Files
supabase/apps/studio/components/ui/InlineLink.tsx
Joshen Lim e00ba41fd1 Chore/toggle for storage client connection s3 (#31209)
* Scaffold UI components

* Hook up API

* Fix type
2025-01-06 10:52:46 +07:00

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>
)
}