generated from Luis/nextjs-python-web-template
add: dynamic schema form with pure/impure seperation
This commit is contained in:
24
pkgs/ui/src/components/createMachineForm/interfaces.ts
Normal file
24
pkgs/ui/src/components/createMachineForm/interfaces.ts
Normal file
@@ -0,0 +1,24 @@
|
||||
import { ReactElement, ReactNode } from "react";
|
||||
import { UseFormReturn } from "react-hook-form";
|
||||
|
||||
export type StepId = "template" | "modules" | "config" | "save";
|
||||
|
||||
export type CreateMachineForm = {
|
||||
name: string;
|
||||
config: any;
|
||||
};
|
||||
|
||||
export type FormHooks = UseFormReturn<CreateMachineForm>;
|
||||
|
||||
export type FormStep = {
|
||||
id: StepId;
|
||||
label: string;
|
||||
content: FormStepContent;
|
||||
};
|
||||
|
||||
export interface FormStepContentProps {
|
||||
formHooks: FormHooks;
|
||||
handleNext: () => void;
|
||||
}
|
||||
|
||||
export type FormStepContent = ReactElement<FormStepContentProps>;
|
||||
Reference in New Issue
Block a user