import React from 'react'
import FormikControlString from './FormikControlTypes/FormikControlString'
import FormikControlPassword from './FormikControlTypes/FormikControlPassword'
import FormikControlUserConsent from './FormikControlTypes/FormikControlUserConsent'
import FormikControlCheckbox from './FormikControlTypes/FormikControlCheckbox'


export function FormikControl(props) {
    const { control, ...rest } = props
    switch (control) {
        case 'string':
            return <FormikControlString {...rest} />
        case 'password':
            return <FormikControlPassword {...rest} />
        // case 'textarea':
        //     return <FormikInputTextarea {...rest} />
        // case 'select':
        //     return <FormikInputSelect {...rest} />
        // case 'radio':
        //     return <FormikInputRadioGroup {...rest} />
        // case 'checkbox':
        //     return <FormikInputCheckbox {...rest} />
        // case 'phone':
        //     return <FormikInputPhone {...rest} />
        case 'userconsent':
            return <FormikControlUserConsent {...rest} />
        case 'checkbox':
            return <FormikControlCheckbox {...rest} />
        default:
            return null
    }
}

export default FormikControl
