Files
supabase/apps/studio/components/interfaces/Support/SupportLink.tsx
2026-04-01 10:22:37 +02:00

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