evals
scenario-1
scenario-10
scenario-2
scenario-3
scenario-4
scenario-5
scenario-6
scenario-7
scenario-8
scenario-9
Build a Next.js Server Component page that accepts and validates URL search parameters for product filtering. Invalid parameters must cause validation errors.
Create a server-side page at /app/products/page.tsx that:
Accepts these URL query parameters:
Validates parameters on the server with strict validation enabled. Invalid values must throw errors, not return null.
Displays the validated parameters in the page:
Valid URL with all parameters: ?category=electronics&minPrice=100&maxPrice=500&inStock=true&page=2 should display all filter values @test
Valid URL with partial parameters: ?category=books&page=1 should display only the provided values @test
Invalid category value: ?category=furniture should throw a validation error @test
Invalid price value: ?minPrice=abc should throw a validation error @test
Provides type-safe URL search parameter state management with server-side parsing and validation.