@@ -53,6 +53,7 @@ import {
5353 SEVERITY_OPTIONS ,
5454} from './Support.constants'
5555import { formatMessage , uploadAttachments } from './SupportForm.utils'
56+ import { Admonition } from 'ui-patterns'
5657
5758const MAX_ATTACHMENTS = 5
5859const INCLUDE_DISCUSSIONS = [ 'Problem' , 'Database_unresponsive' ]
@@ -68,7 +69,14 @@ interface SupportFormV2Props {
6869export const SupportFormV2 = ( { setSentCategory, setSelectedProject } : SupportFormV2Props ) => {
6970 const { profile } = useProfile ( )
7071 const supabaseClient = useSupabaseClient ( )
71- const { ref, slug, category : urlCategory , subject : urlSubject , message : urlMessage } = useParams ( )
72+ const {
73+ ref,
74+ slug,
75+ category : urlCategory ,
76+ subject : urlSubject ,
77+ message : urlMessage ,
78+ error,
79+ } = useParams ( )
7280
7381 const uploadButtonRef = useRef ( null )
7482 const [ isSubmitting , setIsSubmitting ] = useState ( false )
@@ -203,7 +211,7 @@ export const SupportFormV2 = ({ setSentCategory, setSelectedProject }: SupportFo
203211 organizationSlug : values . organizationSlug === 'no-org' ? undefined : values . organizationSlug ,
204212 library :
205213 values . category === 'Problem' && selectedLibrary !== undefined ? selectedLibrary . key : '' ,
206- message : formatMessage ( values . message , attachments ) ,
214+ message : formatMessage ( values . message , attachments , error ) ,
207215 verified : true ,
208216 tags : [ 'dashboard-support-form' ] ,
209217 siteUrl : '' ,
@@ -621,6 +629,15 @@ export const SupportFormV2 = ({ setSentCategory, setSelectedProject }: SupportFo
621629 placeholder = "Describe the issue you're facing, along with any relevant information. Please be as detailed and specific as possible."
622630 />
623631 </ FormControl_Shadcn_ >
632+ { error !== undefined && (
633+ < Admonition
634+ showIcon = { false }
635+ type = "default"
636+ className = "mt-2"
637+ title = "The error that you ran into will be included in your message for reference"
638+ description = { `Error: ${ error } ` }
639+ />
640+ ) }
624641 </ FormItemLayout >
625642 ) }
626643 />
0 commit comments