mirror of
https://github.com/supabase/supabase.git
synced 2026-10-13 13:19:09 +03:00
* 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>
36 lines
843 B
TypeScript
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>
|
|
)
|
|
}
|