Quote Page
The quote page (app/cotizacion/page.tsx) is where users submit insurance quote requests. It integrates the CotizacionForm component and supports pre-filled form values through URL query parameters.
Route
- Path:
/cotizacion - File:
app/cotizacion/page.tsx - Type: Server Component (async)
Page Purpose
The quote page serves as the primary conversion point where users:- Select their insurance type
- Choose coverage level (for automotive insurance)
- Provide contact information
- Submit a quote request
URL Parameters
The page accepts two optional query parameters for pre-filling the form:Parameters
| Parameter | Type | Description | Example |
|---|---|---|---|
tipo | string | Insurance type selection | automotor, hogar, vida |
subtipo | string | Coverage subtype (URL-encoded) | Responsabilidad%20Civil, Todo%20Riesgo |
Parameter Handling
The
subtipo parameter is URL-decoded using decodeURIComponent() to handle spaces and special characters in coverage names.Complete Implementation
CotizacionForm Integration
The page renders theCotizacionForm component, passing URL parameters as props:
Props Passed
Component Import
app/components/CotizacionForm.tsx and handles all form UI, validation, and submission logic.
See the CotizacionForm component documentation for detailed information about form fields, validation, and submission handling.
URL Parameter Examples
Basic Insurance Type Selection
- Automotor
- Hogar
- Vida
URL:
/cotizacion?tipo=automotorPre-fills the form with:- Insurance type: “Automotor”
- Coverage: User selects from dropdown
Insurance Type with Coverage Level
- Responsabilidad Civil
- Terceros Completos
- Todo Riesgo
URL:
/cotizacion?tipo=automotor&subtipo=Responsabilidad%20CivilPre-fills the form with:- Insurance type: “Automotor”
- Coverage: “Responsabilidad Civil”
User Flow
Direct Navigation
- User clicks “Solicitar Cotización” from navigation or hero
- Lands on
/cotizacionwith no parameters - Selects insurance type and coverage manually
- Fills in contact information
- Submits quote request
Pre-filled Flow (from Home Page)
- User clicks service card (e.g., “Cotizar ahora” on Automotor)
- Navigates to
/cotizacion?tipo=automotor - Form loads with insurance type pre-selected
- User selects coverage level
- Fills remaining fields and submits
Fully Pre-filled Flow (from Coverage Cards)
- User clicks coverage tier button (e.g., “Cotizar Terceros”)
- Navigates to
/cotizacion?tipo=automotor&subtipo=Terceros%20Completos - Form loads with both type and coverage pre-selected
- User only needs to provide contact information
- Submits quote request
Server Component Pattern
The page uses Next.js 13+ server component patterns:Async/Await for searchParams
In Next.js 13+,
searchParams is a Promise that must be awaited in server components.Type Safety
Bothtipo and subtipo are typed as optional strings:
Integration Points
Incoming Links from Home Page
The home page links to this page with various parameter combinations: Service Cards:Navigation Links
The page is accessible from:- Main navigation header
- Hero section CTA button
- Service card links (6 insurance types)
- Coverage tier buttons (3 automotive levels)
URL Encoding Examples
Spaces in Parameters
Multiple Word Parameters
Best Practices
Always Decode URL Parameters
Handle Missing Parameters
Related Documentation
- CotizacionForm Component - Detailed form implementation
- Home Page - Source of navigation links
- Header Component - Navigation header implementation