Files
supabase/apps/studio/components/ui/InlineLink.tsx
a61927e790 feat: update dpa retrieval (#37563)
* feat: update dpa retrieval

* add tracking for other legal docs

* ci: Autofix updates from GitHub workflow

* update api types

* update pdf

* Refactor DPA with text confirm modal

* Nit consistency with using a and buttons

* Update TextConfirmModal

---------

Co-authored-by: pamelachia <26612111+pamelachia@users.noreply.github.com>
Co-authored-by: Joshen Lim <joshenlimek@gmail.com>
2025-08-07 16:12:54 +08:00

36 lines
843 B
TypeScript

import Link from 'next/link'
import { PropsWithChildren } from 'react'
import { cn } from 'ui'
interface InlineLinkProps {
href: string
className?: string
target?: string
rel?: string
onClick?: () => void
}
export const InlineLinkClassName =
'underline transition underline-offset-2 decoration-foreground-lighter hover:decoration-foreground text-foreground'
export const InlineLink = ({
href,
className: _className,
children,
...props
}: PropsWithChildren<InlineLinkProps>) => {
const className = cn(InlineLinkClassName, _className)
if (href.startsWith('http')) {
return (
<a className={className} href={href} target="_blank" rel="noreferrer noopener" {...props}>
{children}
</a>
)
}
return (
<Link className={className} href={href} {...props}>
{children}
</Link>
)
}