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

const initialValues = {
    
    
    
    
    
    
    
    
    
    
    
    
    
    trade: '',
    
    
    
    
    
    
    
    
    
    
    
    
    
    mood: 'confident',
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    confidence_level: 'very_low',
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    discipline_level: 'very_low',
    
    
    
    
    
    
    
    stress_score: '',
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    emotions_notes: '',
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    recorded_at: '',
    
    
    
    
    
    
    
    
    
}


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

    
    

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























  <FormField label="Mood" labelFor="mood">
      <Field name="mood" id="mood" component="select">
      
        <option value="confident">confident</option>
      
        <option value="calm">calm</option>
      
        <option value="focused">focused</option>
      
        <option value="neutral">neutral</option>
      
        <option value="anxious">anxious</option>
      
        <option value="fearful">fearful</option>
      
        <option value="frustrated">frustrated</option>
      
        <option value="angry">angry</option>
      
        <option value="revengeful">revengeful</option>
      
        <option value="euphoric">euphoric</option>
      
        <option value="tired">tired</option>
      
        <option value="stressed">stressed</option>
      
      </Field>
  </FormField>



























  <FormField label="ConfidenceLevel" labelFor="confidence_level">
      <Field name="confidence_level" id="confidence_level" component="select">
      
        <option value="very_low">very_low</option>
      
        <option value="low">low</option>
      
        <option value="medium">medium</option>
      
        <option value="high">high</option>
      
        <option value="very_high">very_high</option>
      
      </Field>
  </FormField>



























  <FormField label="DisciplineLevel" labelFor="discipline_level">
      <Field name="discipline_level" id="discipline_level" component="select">
      
        <option value="very_low">very_low</option>
      
        <option value="low">low</option>
      
        <option value="medium">medium</option>
      
        <option value="high">high</option>
      
        <option value="very_high">very_high</option>
      
      </Field>
  </FormField>



















    <FormField
        label="StressScore"
    >
        <Field
            type="number"
            name="stress_score"
            placeholder="StressScore"
        />
    </FormField>























    <FormField label="EmotionsNotes" hasTextareaHeight>
        <Field name="emotions_notes" as="textarea" placeholder="EmotionsNotes" />
    </FormField>



































  <FormField
      label="RecordedAt"
  >
      <Field
          type="datetime-local"
          name="recorded_at"
          placeholder="RecordedAt"
      />
  </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('/mood_entries/mood_entries-list')}/>
              </BaseButtons>
            </Form>
          </Formik>
        </CardBox>
      </SectionMain>
    </>
  )
}

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

export default Mood_entriesNew
