import { mdiAccount, mdiChartTimelineVariant, mdiMail, mdiUpload } from '@mdi/js'
import Head from 'next/head'
import React, { ReactElement } from 'react'
import CardBox from '../../components/CardBox'
import LayoutAuthenticated from '../../layouts/Authenticated'
import SectionMain from '../../components/SectionMain'
import SectionTitleLineWithButton from '../../components/SectionTitleLineWithButton'
import { getPageTitle } from '../../config'

import { Field, Form, Formik } from 'formik'
import FormField from '../../components/FormField'
import BaseDivider from '../../components/BaseDivider'
import BaseButtons from '../../components/BaseButtons'
import BaseButton from '../../components/BaseButton'
import FormCheckRadio from '../../components/FormCheckRadio'
import FormCheckRadioGroup from '../../components/FormCheckRadioGroup'
import FormFilePicker from '../../components/FormFilePicker'
import FormImagePicker from '../../components/FormImagePicker'
import { SwitchField } from '../../components/SwitchField'

import { SelectField } from '../../components/SelectField'
import { SelectFieldMany } from "../../components/SelectFieldMany";
import {RichTextField} from "../../components/RichTextField";

import { create } from '../../stores/kyc_verifications/kyc_verificationsSlice'
import { useAppDispatch } from '../../stores/hooks'
import { useRouter } from 'next/router'
import moment from 'moment';

const initialValues = {
    
    
    
    
    
    
    
    
    
    
    
    
    
    user: '',
    
    
    
    
    
    
    
    
    
    
    
    
    
    status: 'not_started',
    
    
    
    
    
    
    
    document_type: '',
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    document_files: [],
    
    
    
    
    
    
    full_name_on_document: '',
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    document_number: '',
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    submitted_at: '',
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    reviewed_at: '',
    
    
    
    
    
    
    
    
    
    
    
    review_note: '',
    
    
    
    
    
    
    
    
    
    
    
    
    
}


const Kyc_verificationsNew = () => {
  const router = useRouter()
  const dispatch = useAppDispatch()

    
    

  const handleSubmit = async (data) => {
    await dispatch(create(data))
    await router.push('/kyc_verifications/kyc_verifications-list')
  }
  return (
    <>
      <Head>
        <title>{getPageTitle('New Item')}</title>
      </Head>
      <SectionMain>
        <SectionTitleLineWithButton icon={mdiChartTimelineVariant} title="New Item" main>
        {''}
        </SectionTitleLineWithButton>
        <CardBox>
          <Formik
            initialValues={
                
                initialValues
                
            }
            onSubmit={(values) => handleSubmit(values)}
          >
            <Form>





















  <FormField label="User" labelFor="user">
      <Field name="user" id="user" component={SelectField} options={[]} itemRef={'users'}></Field>
  </FormField>























  <FormField label="Status" labelFor="status">
      <Field name="status" id="status" component="select">
      
        <option value="not_started">not_started</option>
      
        <option value="pending">pending</option>
      
        <option value="approved">approved</option>
      
        <option value="rejected">rejected</option>
      
      </Field>
  </FormField>













  <FormField
      label="Documenttype"
  >
      <Field
          name="document_type"
          placeholder="Documenttype"
      />
  </FormField>


















































  <FormField>
      <Field
          label='Documentfiles'
          color='info'
          icon={mdiUpload}
          path={'kyc_verifications/document_files'}
          name='document_files'
          id='document_files'
          schema={{
            size: undefined,
            formats: undefined,
          }}
          component={FormFilePicker}
      ></Field>
  </FormField>




  <FormField
      label="Fullnameondocument"
  >
      <Field
          name="full_name_on_document"
          placeholder="Fullnameondocument"
      />
  </FormField>



























  <FormField
      label="Documentnumber"
  >
      <Field
          name="document_number"
          placeholder="Documentnumber"
      />
  </FormField>





































  <FormField
      label="Submittedat"
  >
      <Field
          type="datetime-local"
          name="submitted_at"
          placeholder="Submittedat"
      />
  </FormField>



























  <FormField
      label="Reviewedat"
  >
      <Field
          type="datetime-local"
          name="reviewed_at"
          placeholder="Reviewedat"
      />
  </FormField>



















    <FormField label="Reviewnote" hasTextareaHeight>
        <Field name="review_note" as="textarea" placeholder="Reviewnote" />
    </FormField>























              <BaseDivider />
              <BaseButtons>
                <BaseButton type="submit" color="info" label="Submit" />
                <BaseButton type="reset" color="info" outline label="Reset" />
                <BaseButton type='reset' color='danger' outline label='Cancel' onClick={() => router.push('/kyc_verifications/kyc_verifications-list')}/>
              </BaseButtons>
            </Form>
          </Formik>
        </CardBox>
      </SectionMain>
    </>
  )
}

Kyc_verificationsNew.getLayout = function getLayout(page: ReactElement) {
  return (
      <LayoutAuthenticated
        
          permission={'CREATE_KYC_VERIFICATIONS'}
        
      >
          {page}
      </LayoutAuthenticated>
  )
}

export default Kyc_verificationsNew
