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

const initialValues = {
    
    
    name: '',
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    persona: '',
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    system_prompt: '',
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    tone: 'friendly',
    
    
    
    
    
    
    
    
    supported_subjects: '',
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    visibility: 'public',
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    organization: '',
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    avatar: [],
    
    
    
    
    
    
    
    
    
    
    
    is_default: false,
    
    
    
    
    
    
    
    
}


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

    
    

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































      <FormField label='Persona' hasTextareaHeight>
          <Field
              name='persona'
              id='persona'
              component={RichTextField}
          ></Field>
      </FormField>



























      <FormField label='SystemPrompt' hasTextareaHeight>
          <Field
              name='system_prompt'
              id='system_prompt'
              component={RichTextField}
          ></Field>
      </FormField>





































  <FormField label="Tone" labelFor="tone">
      <Field name="tone" id="tone" component="select">
      
        <option value="friendly">friendly</option>
      
        <option value="strict">strict</option>
      
        <option value="socratic">socratic</option>
      
        <option value="concise">concise</option>
      
        <option value="detailed">detailed</option>
      
      </Field>
  </FormField>















    <FormField label="SupportedSubjects" hasTextareaHeight>
        <Field name="supported_subjects" as="textarea" placeholder="SupportedSubjects" />
    </FormField>







































  <FormField label="Visibility" labelFor="visibility">
      <Field name="visibility" id="visibility" component="select">
      
        <option value="public">public</option>
      
        <option value="private">private</option>
      
        <option value="organization">organization</option>
      
      </Field>
  </FormField>































  <FormField label="Organization" labelFor="organization">
      <Field name="organization" id="organization" component={SelectField} options={[]} itemRef={'organizations'}></Field>
  </FormField>































  <FormField>
      <Field
          label='Avatar'
          color='info'
          icon={mdiUpload}
          path={'ai_mentor_profiles/avatar'}
          name='avatar'
          id='avatar'
          schema={{
            size: undefined,
            formats: undefined,
          }}
          component={FormImagePicker}
      ></Field>
  </FormField>





















  <FormField label='IsDefault' labelFor='is_default'>
      <Field
          name='is_default'
          id='is_default'
          component={SwitchField}
      ></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('/ai_mentor_profiles/ai_mentor_profiles-list')}/>
              </BaseButtons>
            </Form>
          </Formik>
        </CardBox>
      </SectionMain>
    </>
  )
}

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

export default Ai_mentor_profilesNew
