refactored code
This commit is contained in:
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user