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

const initialValues = {
    
    
    name: '',
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    tier: 'premium',
    
    
    
    
    
    
    
    price_monthly: '',
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    price_yearly: '',
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    unlimited_likes: false,
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    unlimited_chats: false,
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    see_who_liked_me: false,
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    advanced_filters: false,
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    passport_mode: false,
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    boost_profile: false,
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    read_receipts: false,
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    incognito_mode: false,
    
    
    
    
    
    
    
    
    
    
    description: '',
    
    
    
    
    
    
    
    
    
    
    
    
    
}


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

    
    

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









































  <FormField label="Tier" labelFor="tier">
      <Field name="tier" id="tier" component="select">
      
        <option value="premium">premium</option>
      
        <option value="premium_plus">premium_plus</option>
      
      </Field>
  </FormField>



















    <FormField
        label="PriceMonthly"
    >
        <Field
            type="number"
            name="price_monthly"
            placeholder="PriceMonthly"
        />
    </FormField>



























    <FormField
        label="PriceYearly"
    >
        <Field
            type="number"
            name="price_yearly"
            placeholder="PriceYearly"
        />
    </FormField>





































  <FormField label='UnlimitedLikes' labelFor='unlimited_likes'>
      <Field
          name='unlimited_likes'
          id='unlimited_likes'
          component={SwitchField}
      ></Field>
  </FormField>



























  <FormField label='UnlimitedChats' labelFor='unlimited_chats'>
      <Field
          name='unlimited_chats'
          id='unlimited_chats'
          component={SwitchField}
      ></Field>
  </FormField>



























  <FormField label='SeeWhoLikedMe' labelFor='see_who_liked_me'>
      <Field
          name='see_who_liked_me'
          id='see_who_liked_me'
          component={SwitchField}
      ></Field>
  </FormField>



























  <FormField label='AdvancedFilters' labelFor='advanced_filters'>
      <Field
          name='advanced_filters'
          id='advanced_filters'
          component={SwitchField}
      ></Field>
  </FormField>



























  <FormField label='PassportMode' labelFor='passport_mode'>
      <Field
          name='passport_mode'
          id='passport_mode'
          component={SwitchField}
      ></Field>
  </FormField>



























  <FormField label='BoostProfile' labelFor='boost_profile'>
      <Field
          name='boost_profile'
          id='boost_profile'
          component={SwitchField}
      ></Field>
  </FormField>



























  <FormField label='ReadReceipts' labelFor='read_receipts'>
      <Field
          name='read_receipts'
          id='read_receipts'
          component={SwitchField}
      ></Field>
  </FormField>



























  <FormField label='IncognitoMode' labelFor='incognito_mode'>
      <Field
          name='incognito_mode'
          id='incognito_mode'
          component={SwitchField}
      ></Field>
  </FormField>













    <FormField label="Description" hasTextareaHeight>
        <Field name="description" as="textarea" placeholder="Description" />
    </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('/premium_plans/premium_plans-list')}/>
              </BaseButtons>
            </Form>
          </Formik>
        </CardBox>
      </SectionMain>
    </>
  )
}

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

export default Premium_plansNew
