mirror of
https://github.com/supabase/supabase.git
synced 2026-05-07 17:30:25 -04:00
4a0bb36ca8
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> Co-authored-by: Ivan Vasilov <vasilov.ivan@gmail.com>
29 lines
681 B
TypeScript
29 lines
681 B
TypeScript
import Link from 'next/link'
|
|
import type { ComponentProps, PropsWithChildren } from 'react'
|
|
|
|
import { createSupportFormUrl, type SupportFormUrlKeys } from './SupportForm.utils'
|
|
import { takeBreadcrumbSnapshot } from '@/lib/breadcrumbs'
|
|
|
|
export const SupportLink = ({
|
|
children,
|
|
queryParams,
|
|
...props
|
|
}: PropsWithChildren<
|
|
{ queryParams?: Partial<SupportFormUrlKeys> } & Omit<ComponentProps<typeof Link>, 'href'>
|
|
>) => {
|
|
const href = createSupportFormUrl(queryParams ?? {})
|
|
|
|
return (
|
|
<Link
|
|
{...props}
|
|
href={href}
|
|
onClick={(event) => {
|
|
takeBreadcrumbSnapshot()
|
|
props.onClick?.(event)
|
|
}}
|
|
>
|
|
{children}
|
|
</Link>
|
|
)
|
|
}
|