# Zod Installation Required

To use the updated validation with Zod, you need to install the Zod package:

```bash
npm install zod
```

## What's Updated

The visitor contact form validation has been updated to use Zod instead of custom validation functions:

### ✅ **Zod Schema Benefits:**

- **Type Safety**: Automatic TypeScript type inference
- **Better Error Messages**: More detailed and consistent error handling
- **Schema Reusability**: Can be used on both client and server
- **Built-in Validation**: Email, min length, required field validation
- **Internationalization**: Error messages are still localized

### **Schema Definition:**

```typescript
const schema = z.object({
  name: z.string().min(1, "Name required").min(2, "Min 2 chars").trim(),
  email: z.string().min(1, "Email required").email("Invalid email").trim(),
  question: z
    .string()
    .min(1, "Question required")
    .min(10, "Min 10 chars")
    .trim(),
});
```

### **Validation Process:**

1. Form data is extracted from FormData
2. Zod schema validates the data
3. If validation fails, errors are mapped to form fields
4. If validation passes, data is sent to API

The form will work exactly the same way but with more robust validation powered by Zod.
