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

const initialValues = {
    
    
    
    
    
    
    
    
    
    
    
    
    
    market_symbol: '',
    
    
    
    
    pe_ratio: '',
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    eps: '',
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    market_cap: '',
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    revenue: '',
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    dividend_yield: '',
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    beta: '',
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    shares_outstanding: '',
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    as_of_at: '',
    
    
    
    
    
    
    
    
    
    
    source: '',
    
    
    
    
    
    
    
    
    
    
    
    
    
    
}


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

    
    

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















    <FormField
        label="P/ERatio"
    >
        <Field
            type="number"
            name="pe_ratio"
            placeholder="P/ERatio"
        />
    </FormField>



























    <FormField
        label="EPS"
    >
        <Field
            type="number"
            name="eps"
            placeholder="EPS"
        />
    </FormField>



























    <FormField
        label="MarketCap"
    >
        <Field
            type="number"
            name="market_cap"
            placeholder="MarketCap"
        />
    </FormField>



























    <FormField
        label="Revenue"
    >
        <Field
            type="number"
            name="revenue"
            placeholder="Revenue"
        />
    </FormField>



























    <FormField
        label="DividendYield"
    >
        <Field
            type="number"
            name="dividend_yield"
            placeholder="DividendYield"
        />
    </FormField>



























    <FormField
        label="Beta"
    >
        <Field
            type="number"
            name="beta"
            placeholder="Beta"
        />
    </FormField>



























    <FormField
        label="SharesOutstanding"
    >
        <Field
            type="number"
            name="shares_outstanding"
            placeholder="SharesOutstanding"
        />
    </FormField>































  <FormField
      label="AsOfAt"
  >
      <Field
          type="datetime-local"
          name="as_of_at"
          placeholder="AsOfAt"
      />
  </FormField>

















  <FormField
      label="Source"
  >
      <Field
          name="source"
          placeholder="Source"
      />
  </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('/symbol_fundamentals/symbol_fundamentals-list')}/>
              </BaseButtons>
            </Form>
          </Formik>
        </CardBox>
      </SectionMain>
    </>
  )
}

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

export default Symbol_fundamentalsNew
