feat: ReservationFlow aplica prefill de query params no boot
This commit is contained in:
parent
8365c09ed8
commit
45ffd9110c
@ -1,5 +1,9 @@
|
|||||||
import { useState } from 'react'
|
import { useState } from 'react'
|
||||||
import { useReservationForm } from '@/hooks/useReservationForm'
|
import { useReservationForm } from '@/hooks/useReservationForm'
|
||||||
|
import { parsePrefillFromURL } from '@/lib/prefill'
|
||||||
|
|
||||||
|
// Captura prefill UMA vez no boot (módulo). Evita re-parse a cada render.
|
||||||
|
const initialPrefill = parsePrefillFromURL()
|
||||||
import { chatwootApi, type CreateReservationResponse } from '@/lib/chatwootApi'
|
import { chatwootApi, type CreateReservationResponse } from '@/lib/chatwootApi'
|
||||||
import { onlyDigits } from '@/lib/formatters'
|
import { onlyDigits } from '@/lib/formatters'
|
||||||
import { StayDetailsStep } from './StayDetailsStep'
|
import { StayDetailsStep } from './StayDetailsStep'
|
||||||
@ -24,7 +28,7 @@ export function ReservationFlow() {
|
|||||||
fotos,
|
fotos,
|
||||||
canSubmit,
|
canSubmit,
|
||||||
reset,
|
reset,
|
||||||
} = useReservationForm()
|
} = useReservationForm(initialPrefill)
|
||||||
|
|
||||||
const [phase, setPhase] = useState<Phase>('form')
|
const [phase, setPhase] = useState<Phase>('form')
|
||||||
const [submitting, setSubmitting] = useState(false)
|
const [submitting, setSubmitting] = useState(false)
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user