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

const initialValues = {
    
    
    
    
    
    
    
    
    
    
    
    
    
    tenant: '',
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    team: '',
    
    
    
    
    name: '',
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    description: '',
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    e2ee_enabled: false,
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    lobby_enabled: false,
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    recording_enabled: false,
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    transcription_enabled: false,
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    canvas_enabled: false,
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    default_layout_mode: 'auto',
    
    
    
    
    
    
    
    
    
    
    max_participants: '',
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    template_status: 'active',
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    organizations: '',
    
    
    
}


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

    
    

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



























  <FormField label="Team" labelFor="team">
      <Field name="team" id="team" component={SelectField} options={[]} itemRef={'teams'}></Field>
  </FormField>









  <FormField
      label="TemplateName"
  >
      <Field
          name="name"
          placeholder="TemplateName"
      />
  </FormField>





























    <FormField label="Description" hasTextareaHeight>
        <Field name="description" as="textarea" placeholder="Description" />
    </FormField>









































  <FormField label='E2EEEnabled' labelFor='e2ee_enabled'>
      <Field
          name='e2ee_enabled'
          id='e2ee_enabled'
          component={SwitchField}
      ></Field>
  </FormField>



























  <FormField label='LobbyEnabled' labelFor='lobby_enabled'>
      <Field
          name='lobby_enabled'
          id='lobby_enabled'
          component={SwitchField}
      ></Field>
  </FormField>



























  <FormField label='RecordingEnabled' labelFor='recording_enabled'>
      <Field
          name='recording_enabled'
          id='recording_enabled'
          component={SwitchField}
      ></Field>
  </FormField>



























  <FormField label='TranscriptionEnabled' labelFor='transcription_enabled'>
      <Field
          name='transcription_enabled'
          id='transcription_enabled'
          component={SwitchField}
      ></Field>
  </FormField>



























  <FormField label='CanvasEnabled' labelFor='canvas_enabled'>
      <Field
          name='canvas_enabled'
          id='canvas_enabled'
          component={SwitchField}
      ></Field>
  </FormField>

























  <FormField label="DefaultLayoutMode" labelFor="default_layout_mode">
      <Field name="default_layout_mode" id="default_layout_mode" component="select">
      
        <option value="auto">auto</option>
      
        <option value="grid">grid</option>
      
        <option value="speaker">speaker</option>
      
        <option value="presentation">presentation</option>
      
      </Field>
  </FormField>



















    <FormField
        label="MaxParticipants"
    >
        <Field
            type="number"
            name="max_participants"
            placeholder="MaxParticipants"
        />
    </FormField>



































  <FormField label="TemplateStatus" labelFor="template_status">
      <Field name="template_status" id="template_status" component="select">
      
        <option value="active">active</option>
      
        <option value="draft">draft</option>
      
        <option value="archived">archived</option>
      
      </Field>
  </FormField>































  <FormField label="organizations" labelFor="organizations">
      <Field name="organizations" id="organizations" component={SelectField} options={[]} itemRef={'organizations'}></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('/conference_templates/conference_templates-list')}/>
              </BaseButtons>
            </Form>
          </Formik>
        </CardBox>
      </SectionMain>
    </>
  )
}

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

export default Conference_templatesNew
