import {ReactNode} from "react";
import {DynamicFormInterface, FormSection} from "../../../../models/JsonForms";

export type DynamicFormCreatorProps = {
    children?: ReactNode
    form: DynamicFormInterface,
    formDataI: Record<string, any>
    mode?: 'create' | 'edit' | 'view'
    doc_id?: string

}

export interface SimpleAction {
    type: 'simple'
    value: string | number | null
    key: string

}

export interface WithSumAction {
    type: 'with_sum'
    value: string | number
    key: string
    key_prefix: string

}

export interface IterableAction {
    type: 'iterable'
    value: string | number | null
    key: string
    iterable_count: number

}


export interface AddIterableSectionAction {
    type: 'add_iterable_section'
    section: FormSection
    sec_i: number
}


export interface RemoveIterableSectionAction {
    type: 'remove_iterable_section'
    section: FormSection
    sec_i: number
    iterable_count: number
}
