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

const initialValues = {
    
    
    
    
    
    
    
    
    
    
    
    
    
    user: '',
    
    
    
    
    
    
    
    
    
    
    push_new_match: false,
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    push_new_message: false,
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    push_profile_like: false,
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    push_daily_spark: false,
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    push_premium: false,
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    privacy_show_distance: false,
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    privacy_show_online_status: false,
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    privacy_allow_discovery: false,
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    updated_on: '',
    
    
    
    
    
    
    
    
    
}


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

    
    

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

























  <FormField label='Push:NewMatch' labelFor='push_new_match'>
      <Field
          name='push_new_match'
          id='push_new_match'
          component={SwitchField}
      ></Field>
  </FormField>



























  <FormField label='Push:NewMessage' labelFor='push_new_message'>
      <Field
          name='push_new_message'
          id='push_new_message'
          component={SwitchField}
      ></Field>
  </FormField>



























  <FormField label='Push:ProfileLike' labelFor='push_profile_like'>
      <Field
          name='push_profile_like'
          id='push_profile_like'
          component={SwitchField}
      ></Field>
  </FormField>



























  <FormField label='Push:DailySpark' labelFor='push_daily_spark'>
      <Field
          name='push_daily_spark'
          id='push_daily_spark'
          component={SwitchField}
      ></Field>
  </FormField>



























  <FormField label='Push:Premium' labelFor='push_premium'>
      <Field
          name='push_premium'
          id='push_premium'
          component={SwitchField}
      ></Field>
  </FormField>



























  <FormField label='Privacy:ShowDistance' labelFor='privacy_show_distance'>
      <Field
          name='privacy_show_distance'
          id='privacy_show_distance'
          component={SwitchField}
      ></Field>
  </FormField>



























  <FormField label='Privacy:ShowOnlineStatus' labelFor='privacy_show_online_status'>
      <Field
          name='privacy_show_online_status'
          id='privacy_show_online_status'
          component={SwitchField}
      ></Field>
  </FormField>



























  <FormField label='Privacy:AllowDiscovery' labelFor='privacy_allow_discovery'>
      <Field
          name='privacy_allow_discovery'
          id='privacy_allow_discovery'
          component={SwitchField}
      ></Field>
  </FormField>





















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

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

export default User_settingsNew
