SiteFrontend/src/components/form/formInterfaces.tsx
Teriuihi 973b6b5e7d Add titles to form data and display them dynamically
Incorporated 'title' property into form data objects for dynamic rendering in the GenericForm component. This enhancement facilitates the use of specific titles for different forms, improving readability and user experience.
2024-08-07 00:41:11 +02:00

31 lines
759 B
TypeScript

import * as Yup from "yup";
type InputNames = "username" | "email" | "question" | "discord" | "pc_requirements" | "age" | "pronoun" | "join_date" |
"avg_time" | "available_days" | "available_time" | "staff_experience" | "plugin_experience" | "why_staff" |
"expectations_mod" | "other";
export interface Step {
label: string;
name: InputNames;
type: "text" | "email" | "textarea" | "date";
min_length: number;
max_length: number;
required: boolean;
}
export interface UserInput {
[key: string]: string;
}
export type FormData = {
steps: Step[];
backend: string;
userInput: UserInput;
spec: Yup.Schema<any>
title: string;
}
export interface FormProperties {
path: string
formData: FormData;
}