HelpPanel.utils.ts 471 B

123456789101112
  1. import { SupportFormUrlKeys } from '@/components/interfaces/Support/SupportForm.utils'
  2. export function getSupportLinkQueryParams(
  3. project: { parent_project_ref?: string } | undefined,
  4. org: { slug?: string } | undefined,
  5. routerRef: string | undefined
  6. ): Partial<SupportFormUrlKeys> | undefined {
  7. const projectRef = project?.parent_project_ref ?? routerRef
  8. if (projectRef) return { projectRef }
  9. if (org?.slug) return { orgSlug: org.slug }
  10. return undefined
  11. }