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

const initialValues = {
    
    
    profile_name: '',
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    profile_category: 'domain_expert',
    
    
    
    
    
    
    
    
    goal_statement: '',
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    behavior_rules: '',
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    preferred_sources_description: '',
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    citation_strictness: '',
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    creativity_level: '',
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    compliance_strictness: '',
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    is_active: false,
    
    
    
    
    
    
    
    
}


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

    
    

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









































  <FormField label="ProfileCategory" labelFor="profile_category">
      <Field name="profile_category" id="profile_category" component="select">
      
        <option value="domain_expert">domain_expert</option>
      
        <option value="growth">growth</option>
      
        <option value="copywriting">copywriting</option>
      
        <option value="analysis">analysis</option>
      
        <option value="compliance">compliance</option>
      
        <option value="strategy">strategy</option>
      
        <option value="creative">creative</option>
      
        <option value="custom">custom</option>
      
      </Field>
  </FormField>















    <FormField label="GoalStatement" hasTextareaHeight>
        <Field name="goal_statement" as="textarea" placeholder="GoalStatement" />
    </FormField>





























      <FormField label='BehaviorRules' hasTextareaHeight>
          <Field
              name='behavior_rules'
              id='behavior_rules'
              component={RichTextField}
          ></Field>
      </FormField>

























    <FormField label="PreferredSourcesDescription" hasTextareaHeight>
        <Field name="preferred_sources_description" as="textarea" placeholder="PreferredSourcesDescription" />
    </FormField>































    <FormField
        label="CitationStrictness"
    >
        <Field
            type="number"
            name="citation_strictness"
            placeholder="CitationStrictness"
        />
    </FormField>



























    <FormField
        label="CreativityLevel"
    >
        <Field
            type="number"
            name="creativity_level"
            placeholder="CreativityLevel"
        />
    </FormField>



























    <FormField
        label="ComplianceStrictness"
    >
        <Field
            type="number"
            name="compliance_strictness"
            placeholder="ComplianceStrictness"
        />
    </FormField>





































  <FormField label='IsActive' labelFor='is_active'>
      <Field
          name='is_active'
          id='is_active'
          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('/brain_profiles/brain_profiles-list')}/>
              </BaseButtons>
            </Form>
          </Formik>
        </CardBox>
      </SectionMain>
    </>
  )
}

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

export default Brain_profilesNew
