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

const initialValues = {
    
    
    
    
    
    
    
    
    
    
    
    
    
    patient: '',
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    initiated_by_user: '',
    
    
    
    
    
    
    
    
    
    started_at: '',
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    ended_at: '',
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    channel: 'mobile',
    
    
    
    
    
    
    
    
    transcript: '',
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    assistant_summary: '',
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    outcome: 'info',
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    accounts: '',
    
    
    
}


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

    
    

  const handleSubmit = async (data) => {
    await dispatch(create(data))
    await router.push('/voice_assistant_sessions/voice_assistant_sessions-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="Patient" labelFor="patient">
      <Field name="patient" id="patient" component={SelectField} options={[]} itemRef={'patients'}></Field>
  </FormField>



























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



















  <FormField
      label="Startedat"
  >
      <Field
          type="datetime-local"
          name="started_at"
          placeholder="Startedat"
      />
  </FormField>



























  <FormField
      label="Endedat"
  >
      <Field
          type="datetime-local"
          name="ended_at"
          placeholder="Endedat"
      />
  </FormField>































  <FormField label="Channel" labelFor="channel">
      <Field name="channel" id="channel" component="select">
      
        <option value="mobile">mobile</option>
      
        <option value="web">web</option>
      
        <option value="smart_speaker">smart_speaker</option>
      
      </Field>
  </FormField>















    <FormField label="Transcript" hasTextareaHeight>
        <Field name="transcript" as="textarea" placeholder="Transcript" />
    </FormField>





























      <FormField label='Assistantsummary' hasTextareaHeight>
          <Field
              name='assistant_summary'
              id='assistant_summary'
              component={RichTextField}
          ></Field>
      </FormField>





































  <FormField label="Outcome" labelFor="outcome">
      <Field name="outcome" id="outcome" component="select">
      
        <option value="info">info</option>
      
        <option value="reminder_created">reminder_created</option>
      
        <option value="alert_created">alert_created</option>
      
        <option value="handoff_to_caregiver">handoff_to_caregiver</option>
      
        <option value="other">other</option>
      
      </Field>
  </FormField>































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

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

export default Voice_assistant_sessionsNew
