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

const initialValues = {
    
    
    
    
    
    
    
    
    
    
    
    
    
    mock_trial: '',
    
    
    
    
    
    
    
    
    
    
    
    
    
    role_name: 'judge',
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    actor_type: 'user',
    
    
    
    
    
    
    
    display_name: '',
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    instructions: '',
    
    
    
    
    
    
    
    
    
    
    
    
}


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

    
    

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























  <FormField label="RoleName" labelFor="role_name">
      <Field name="role_name" id="role_name" component="select">
      
        <option value="judge">judge</option>
      
        <option value="plaintiff">plaintiff</option>
      
        <option value="defendant">defendant</option>
      
        <option value="petitioner">petitioner</option>
      
        <option value="respondent">respondent</option>
      
        <option value="opposing_counsel">opposing_counsel</option>
      
        <option value="witness">witness</option>
      
        <option value="clerk">clerk</option>
      
        <option value="bailiff">bailiff</option>
      
      </Field>
  </FormField>



























  <FormField label="ActorType" labelFor="actor_type">
      <Field name="actor_type" id="actor_type" component="select">
      
        <option value="user">user</option>
      
        <option value="ai">ai</option>
      
      </Field>
  </FormField>













  <FormField
      label="DisplayName"
  >
      <Field
          name="display_name"
          placeholder="DisplayName"
      />
  </FormField>































      <FormField label='Instructions' hasTextareaHeight>
          <Field
              name='instructions'
              id='instructions'
              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('/mock_trial_roles/mock_trial_roles-list')}/>
              </BaseButtons>
            </Form>
          </Formik>
        </CardBox>
      </SectionMain>
    </>
  )
}

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

export default Mock_trial_rolesNew
