import type { SignupFormQuestion } from "@models/Signup";

export interface Question {
  id: string;
  name: string;
  type: OptionTypes;
  enum?: string[];
  enumNames?: string[];
  description?: string;
  required?: boolean;
}

export interface InputProps {
  index: number;
  value: SignupFormQuestion["options"];
  questions: SignupFormQuestion[];
  type: string;
}

export type OptionTypes =
  "text" |
  "info" |
  "integer" |
  "radiobutton" |
  "checkbox" |
  "email" |
  "name";

export const optionTypes = [
  "text",
  "info",
  "integer",
  "radiobutton",
  "checkbox",
  "email",
  "name",
];

export class SignupQuestionError extends Error { }
