import * as Sentry from '@sentry/nextjs'
import { Loader2, Wrench } from 'lucide-react'
import Link from 'next/link'
import { type Dispatch, type PropsWithChildren, useCallback, useReducer } from 'react'
import type { UseFormReturn } from 'react-hook-form'
import SVG from 'react-inlinesvg'
import { toast } from 'sonner'
// End of third-party imports
import CopyButton from 'components/ui/CopyButton'
import InformationBox from 'components/ui/InformationBox'
import { InlineLink, InlineLinkClassName } from 'components/ui/InlineLink'
import { usePlatformStatusQuery } from 'data/platform/platform-status-query'
import { useSendEventMutation } from 'data/telemetry/send-event-mutation'
import { useStateTransition } from 'hooks/misc/useStateTransition'
import { BASE_PATH, DOCS_URL } from 'lib/constants'
import { Button, cn, Tooltip, TooltipContent, TooltipTrigger } from 'ui'
import { AIAssistantOption } from './AIAssistantOption'
import { HighlightProjectRefProvider, useHighlightProjectRefContext } from './HighlightContext'
import { Success } from './Success'
import type { ExtendedSupportCategories } from './Support.constants'
import type { SupportFormValues } from './SupportForm.schema'
import {
createInitialSupportFormState,
type SupportFormActions,
supportFormReducer,
type SupportFormState,
} from './SupportForm.state'
import { SupportFormV2 } from './SupportFormV2'
import { useSupportForm } from './useSupportForm'
function useSupportFormTelemetry() {
const { mutate: sendEvent } = useSendEventMutation()
return useCallback(
({
projectRef,
orgSlug,
category,
}: {
projectRef: string | undefined
orgSlug: string | undefined
category: ExtendedSupportCategories
}) =>
sendEvent({
action: 'support_ticket_submitted',
properties: {
ticketCategory: category,
},
groups: {
project: projectRef,
organization: orgSlug,
},
}),
[sendEvent]
)
}
export function SupportFormPage() {
return (
Email us directly at{' '}
Please, make sure to{' '} {' '} and as much information as possible.
} defaultVisibility={true} hideCollapse={true} /> ) } interface SupportFromBodyProps { form: UseFormReturn