33import { useApi } from '@/hooks/use-api' ;
44import { trackEvent , trackOnboardingEvent } from '@/utils/tracking' ;
55import { zodResolver } from '@hookform/resolvers/zod' ;
6- import { sendGTMEvent } from '@next/third-parties/google' ;
76import { useAction } from 'next-safe-action/hooks' ;
8- import { useRouter , useSearchParams } from 'next/navigation' ;
7+ import { useSearchParams } from 'next/navigation' ;
98import { useEffect , useState } from 'react' ;
109import { useForm } from 'react-hook-form' ;
1110import { toast } from 'sonner' ;
@@ -30,7 +29,6 @@ export function useOnboardingForm({
3029 initialData,
3130 currentStep,
3231} : UseOnboardingFormProps = { } ) {
33- const router = useRouter ( ) ;
3432 const searchParams = useSearchParams ( ) ;
3533 const api = useApi ( ) ;
3634
@@ -114,7 +112,6 @@ export function useOnboardingForm({
114112 onSuccess : async ( { data } ) => {
115113 if ( data ?. success && data ?. organizationId ) {
116114 setIsFinalizing ( true ) ;
117- sendGTMEvent ( { event : 'conversion' } ) ;
118115
119116 // Track organization created
120117 trackEvent ( 'organization_created' , {
@@ -231,14 +228,14 @@ export function useOnboardingForm({
231228 const handlePrefillAll = async ( ) => {
232229 try {
233230 // Fetch frameworks to get valid IDs
234- const response = await api . get < { data : { id : string ; visible : boolean } [ ] } > ( '/v1/frameworks/available' ) ;
231+ const response = await api . get < { data : { id : string ; visible : boolean } [ ] } > (
232+ '/v1/frameworks/available' ,
233+ ) ;
235234 const allFrameworks = Array . isArray ( response . data ?. data ) ? response . data . data : [ ] ;
236235 const visibleFrameworks = allFrameworks . filter ( ( f ) => f . visible ) ;
237-
236+
238237 // Use first two visible frameworks, or just the first one if only one exists
239- const frameworkIds = visibleFrameworks
240- . slice ( 0 , 2 )
241- . map ( ( f : { id : string } ) => f . id ) ;
238+ const frameworkIds = visibleFrameworks . slice ( 0 , 2 ) . map ( ( f : { id : string } ) => f . id ) ;
242239
243240 const prefilledAnswers : Partial < CompanyDetails > = {
244241 frameworkIds : frameworkIds . length > 0 ? frameworkIds : [ ] ,
0 commit comments