mirror of
https://github.com/jakejarvis/jarv.is.git
synced 2026-10-27 13:16:30 -04:00
Refactor contact form validation to use useDebounce for improved performance and streamline error handling. Simplify error retrieval logic and ensure touched state is updated on input changes.
This commit is contained in:
3 files changed
+29
-15
No files matched your search
@@ -0,0 +1,11 @@
|
||||
import { z } from "zod";
|
||||
|
||||
export const ContactSchema = z
|
||||
.object({
|
||||
name: z.string().trim().min(1, { message: "Your name is required." }),
|
||||
email: z.string().email({ message: "Your email address is required." }),
|
||||
message: z.string().trim().min(15, { message: "Your message must be at least 15 characters." }),
|
||||
})
|
||||
.readonly();
|
||||
|
||||
export type ContactInput = z.infer<typeof ContactSchema>;
|
||||
Reference in new issue
Block a user