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/onboarding_responses/onboarding_responsesSlice'
import { useAppDispatch } from '../../stores/hooks'
import { useRouter } from 'next/router'
import moment from 'moment';

const initialValues = {
    
    
    
    
    
    
    
    
    
    
    
    
    
    user: '',
    
    
    
    
    
    
    
    
    
    
    
    
    
    step_name: 'role',
    
    
    
    
    
    
    
    
    learning_goals_text: '',
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    learning_goal_primary: 'apply_ai_at_work',
    
    
    
    
    
    
    
    
    
    
    
    
    
    linkedin_connected: false,
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    github_connected: false,
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    submitted_at: '',
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    organizations: '',
    
    
    
}


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

    
    

  const handleSubmit = async (data) => {
    await dispatch(create(data))
    await router.push('/onboarding_responses/onboarding_responses-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="Step" labelFor="step_name">
      <Field name="step_name" id="step_name" component="select">
      
        <option value="role">role</option>
      
        <option value="learning_goals">learning_goals</option>
      
        <option value="connect_accounts">connect_accounts</option>
      
        <option value="complete">complete</option>
      
      </Field>
  </FormField>















    <FormField label="LearningGoalsText" hasTextareaHeight>
        <Field name="learning_goals_text" as="textarea" placeholder="LearningGoalsText" />
    </FormField>







































  <FormField label="PrimaryLearningGoal" labelFor="learning_goal_primary">
      <Field name="learning_goal_primary" id="learning_goal_primary" component="select">
      
        <option value="apply_ai_at_work">apply_ai_at_work</option>
      
        <option value="career_change">career_change</option>
      
        <option value="productivity">productivity</option>
      
        <option value="leadership">leadership</option>
      
        <option value="build_ai_projects">build_ai_projects</option>
      
        <option value="other">other</option>
      
      </Field>
  </FormField>





























  <FormField label='LinkedInConnected' labelFor='linkedin_connected'>
      <Field
          name='linkedin_connected'
          id='linkedin_connected'
          component={SwitchField}
      ></Field>
  </FormField>



























  <FormField label='GitHubConnected' labelFor='github_connected'>
      <Field
          name='github_connected'
          id='github_connected'
          component={SwitchField}
      ></Field>
  </FormField>





















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



































  <FormField label="organizations" labelFor="organizations">
      <Field name="organizations" id="organizations" component={SelectField} options={[]} itemRef={'organizations'}></Field>
  </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('/onboarding_responses/onboarding_responses-list')}/>
              </BaseButtons>
            </Form>
          </Formik>
        </CardBox>
      </SectionMain>
    </>
  )
}

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

export default Onboarding_responsesNew
