refactored code

This commit is contained in:
2026-05-24 13:26:52 +02:00
parent 1cd0379654
commit ccb09caa4f
4 changed files with 160 additions and 221 deletions
+13
View File
@@ -1,5 +1,6 @@
import z from "zod";
import validator from "validator";
import type { ReactNode } from "react";
export interface FormData {
firstName: string;
@@ -23,6 +24,18 @@ export interface Message {
text: string;
}
export type TextFieldProps = {
label: string;
type?: "text" | "email" | "tel" | "number";
required?: boolean;
errors: string[];
onBlur: () => void;
onChange: (value: string) => void;
value: string | number | null | undefined;
slotProps?: { input?: Record<string, unknown> };
afterInput?: ReactNode;
};
export const createFormSchema = (
t: (key: string) => string,
invoice: boolean,