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

const initialValues = {
    
    
    
    
    
    
    
    
    
    
    
    
    
    user: '',
    
    
    
    
    artist_name: '',
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    profile_type: 'solo_artist',
    
    
    
    
    
    
    
    legal_name: '',
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    country: '',
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    city: '',
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    tax_residency: '',
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    payout_currency: '',
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    press_photos: [],
    
    
    
    
    
    
    
    bio: '',
    
    
    
    
    
    
    
    
    
    
    
    
    
    website_url: '',
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    vk_url: '',
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    youtube_url: '',
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    tiktok_url: '',
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    instagram_url: '',
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    organizations: '',
    
    
    
}


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

    
    

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









































  <FormField label="Profiletype" labelFor="profile_type">
      <Field name="profile_type" id="profile_type" component="select">
      
        <option value="solo_artist">solo_artist</option>
      
        <option value="group">group</option>
      
        <option value="label">label</option>
      
      </Field>
  </FormField>













  <FormField
      label="Legalname"
  >
      <Field
          name="legal_name"
          placeholder="Legalname"
      />
  </FormField>



























  <FormField
      label="Country"
  >
      <Field
          name="country"
          placeholder="Country"
      />
  </FormField>



























  <FormField
      label="City"
  >
      <Field
          name="city"
          placeholder="City"
      />
  </FormField>



























  <FormField
      label="Taxresidency"
  >
      <Field
          name="tax_residency"
          placeholder="Taxresidency"
      />
  </FormField>



























  <FormField
      label="Payoutcurrency"
  >
      <Field
          name="payout_currency"
          placeholder="Payoutcurrency"
      />
  </FormField>

















































  <FormField>
      <Field
          label='Pressphotos'
          color='info'
          icon={mdiUpload}
          path={'artist_profiles/press_photos'}
          name='press_photos'
          id='press_photos'
          schema={{
            size: undefined,
            formats: undefined,
          }}
          component={FormImagePicker}
      ></Field>
  </FormField>









      <FormField label='Bio' hasTextareaHeight>
          <Field
              name='bio'
              id='bio'
              component={RichTextField}
          ></Field>
      </FormField>























  <FormField
      label="WebsiteURL"
  >
      <Field
          name="website_url"
          placeholder="WebsiteURL"
      />
  </FormField>



























  <FormField
      label="VKURL"
  >
      <Field
          name="vk_url"
          placeholder="VKURL"
      />
  </FormField>



























  <FormField
      label="YouTubeURL"
  >
      <Field
          name="youtube_url"
          placeholder="YouTubeURL"
      />
  </FormField>



























  <FormField
      label="TikTokURL"
  >
      <Field
          name="tiktok_url"
          placeholder="TikTokURL"
      />
  </FormField>



























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

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

export default Artist_profilesNew
