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

const initialValues = {
    
    
    
    
    
    
    
    
    
    
    
    
    
    reporter: '',
    
    
    
    
    
    
    
    
    
    
    
    
    
    target_type: 'post',
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    post: '',
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    comment: '',
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    message: '',
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    reported_user: '',
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    live_stream: '',
    
    
    
    
    
    
    
    
    
    
    
    
    
    reason_code: 'spam',
    
    
    
    
    
    
    
    
    details_text: '',
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    status: 'open',
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    assigned_moderator: '',
    
    
    
    
    
    
    
    
    
    reported_at: '',
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    resolved_at: '',
    
    
    
    
    
    
    
    
    
}


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

    
    

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























  <FormField label="TargetType" labelFor="target_type">
      <Field name="target_type" id="target_type" component="select">
      
        <option value="post">post</option>
      
        <option value="comment">comment</option>
      
        <option value="message">message</option>
      
        <option value="user">user</option>
      
        <option value="live_stream">live_stream</option>
      
      </Field>
  </FormField>































  <FormField label="Post" labelFor="post">
      <Field name="post" id="post" component={SelectField} options={[]} itemRef={'posts'}></Field>
  </FormField>



























  <FormField label="Comment" labelFor="comment">
      <Field name="comment" id="comment" component={SelectField} options={[]} itemRef={'comments'}></Field>
  </FormField>



























  <FormField label="Message" labelFor="message">
      <Field name="message" id="message" component={SelectField} options={[]} itemRef={'messages'}></Field>
  </FormField>



























  <FormField label="ReportedUser" labelFor="reported_user">
      <Field name="reported_user" id="reported_user" component={SelectField} options={[]} itemRef={'users'}></Field>
  </FormField>



























  <FormField label="LiveStream" labelFor="live_stream">
      <Field name="live_stream" id="live_stream" component={SelectField} options={[]} itemRef={'live_streams'}></Field>
  </FormField>























  <FormField label="Reason" labelFor="reason_code">
      <Field name="reason_code" id="reason_code" component="select">
      
        <option value="spam">spam</option>
      
        <option value="hate_speech">hate_speech</option>
      
        <option value="harassment">harassment</option>
      
        <option value="nudity">nudity</option>
      
        <option value="violence">violence</option>
      
        <option value="self_harm">self_harm</option>
      
        <option value="copyright">copyright</option>
      
        <option value="scam">scam</option>
      
        <option value="other">other</option>
      
      </Field>
  </FormField>















    <FormField label="Details" hasTextareaHeight>
        <Field name="details_text" as="textarea" placeholder="Details" />
    </FormField>







































  <FormField label="Status" labelFor="status">
      <Field name="status" id="status" component="select">
      
        <option value="open">open</option>
      
        <option value="under_review">under_review</option>
      
        <option value="action_taken">action_taken</option>
      
        <option value="dismissed">dismissed</option>
      
      </Field>
  </FormField>































  <FormField label="AssignedModerator" labelFor="assigned_moderator">
      <Field name="assigned_moderator" id="assigned_moderator" component={SelectField} options={[]} itemRef={'users'}></Field>
  </FormField>



















  <FormField
      label="ReportedAt"
  >
      <Field
          type="datetime-local"
          name="reported_at"
          placeholder="ReportedAt"
      />
  </FormField>



























  <FormField
      label="ResolvedAt"
  >
      <Field
          type="datetime-local"
          name="resolved_at"
          placeholder="ResolvedAt"
      />
  </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('/content_moderation_reports/content_moderation_reports-list')}/>
              </BaseButtons>
            </Form>
          </Formik>
        </CardBox>
      </SectionMain>
    </>
  )
}

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

export default Content_moderation_reportsNew
