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

const initialValues = {
    
    
    session_name: '',
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    campaign: '',
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    ad_project: '',
    
    
    
    
    
    prompt_context: '',
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    white_hat_notes: '',
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    red_hat_notes: '',
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    black_hat_notes: '',
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    yellow_hat_notes: '',
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    green_hat_notes: '',
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    blue_hat_notes: '',
    
    
    
    
    
    
    
    
    
    
    
    
}


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

    
    

  const handleSubmit = async (data) => {
    await dispatch(create(data))
    await router.push('/six_hat_sessions/six_hat_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="SessionName"
  >
      <Field
          name="session_name"
          placeholder="SessionName"
      />
  </FormField>













































  <FormField label="Campaign" labelFor="campaign">
      <Field name="campaign" id="campaign" component={SelectField} options={[]} itemRef={'campaigns'}></Field>
  </FormField>



























  <FormField label="AdProject" labelFor="ad_project">
      <Field name="ad_project" id="ad_project" component={SelectField} options={[]} itemRef={'ad_projects'}></Field>
  </FormField>











    <FormField label="PromptContext" hasTextareaHeight>
        <Field name="prompt_context" as="textarea" placeholder="PromptContext" />
    </FormField>





























      <FormField label='WhiteHatNotes' hasTextareaHeight>
          <Field
              name='white_hat_notes'
              id='white_hat_notes'
              component={RichTextField}
          ></Field>
      </FormField>



























      <FormField label='RedHatNotes' hasTextareaHeight>
          <Field
              name='red_hat_notes'
              id='red_hat_notes'
              component={RichTextField}
          ></Field>
      </FormField>



























      <FormField label='BlackHatNotes' hasTextareaHeight>
          <Field
              name='black_hat_notes'
              id='black_hat_notes'
              component={RichTextField}
          ></Field>
      </FormField>



























      <FormField label='YellowHatNotes' hasTextareaHeight>
          <Field
              name='yellow_hat_notes'
              id='yellow_hat_notes'
              component={RichTextField}
          ></Field>
      </FormField>



























      <FormField label='GreenHatNotes' hasTextareaHeight>
          <Field
              name='green_hat_notes'
              id='green_hat_notes'
              component={RichTextField}
          ></Field>
      </FormField>



























      <FormField label='BlueHatNotes' hasTextareaHeight>
          <Field
              name='blue_hat_notes'
              id='blue_hat_notes'
              component={RichTextField}
          ></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('/six_hat_sessions/six_hat_sessions-list')}/>
              </BaseButtons>
            </Form>
          </Formik>
        </CardBox>
      </SectionMain>
    </>
  )
}

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

export default Six_hat_sessionsNew
