@@ -2,6 +2,7 @@ import React, { useState, useRef, useCallback, useEffect } from 'react';
22import { Send , Rocket , Linkedin } from 'lucide-react' ;
33import emailjs from '@emailjs/browser' ;
44import { emailConfig , RATE_LIMIT_MS } from '../../config' ;
5+ import { scrollToContact as navigateToContactTab } from '../../utils/navigation' ;
56
67interface FormState {
78 name : string ;
@@ -107,14 +108,22 @@ const ContactSection: React.FC = () => {
107108 }
108109 } , [ formState , lastSubmissionTime ] ) ;
109110
110- const handleRequestFeasibilityStudy = useCallback ( ( ) => {
111- setFormState ( prev => ( { ... prev , inquiryType : 'integration' } ) ) ;
112- document . getElementById ( 'inquiryType' ) ?. scrollIntoView ( { behavior : 'smooth' } ) ;
111+ const handleRequestFeasibilityStudy = useCallback ( ( e : React . MouseEvent ) => {
112+ e . preventDefault ( ) ;
113+ navigateToContactTab ( 'integration' ) ;
113114 } , [ ] ) ;
114115
115- const handleScheduleConsultation = useCallback ( ( ) => {
116- setFormState ( prev => ( { ...prev , inquiryType : 'technical' } ) ) ;
117- document . getElementById ( 'inquiryType' ) ?. scrollIntoView ( { behavior : 'smooth' } ) ;
116+ const handleScheduleConsultation = useCallback ( ( e : React . MouseEvent ) => {
117+ e . preventDefault ( ) ;
118+ navigateToContactTab ( 'technical' ) ;
119+ } , [ ] ) ;
120+
121+ useEffect ( ( ) => {
122+ const params = new URLSearchParams ( window . location . hash . split ( '?' ) [ 1 ] ) ;
123+ const inquiry = params . get ( 'inquiryType' ) ;
124+ if ( inquiry ) {
125+ setFormState ( prev => ( { ...prev , inquiryType : inquiry } ) ) ;
126+ }
118127 } , [ ] ) ;
119128
120129 return (
0 commit comments