// @ts-nocheck import React from 'react'; import intl from 'react-intl-universal'; import classNames from 'classnames'; import { FormGroup, InputGroup, ControlGroup } from '@blueprintjs/core'; import { FastField, Field, ErrorMessage } from 'formik'; import { Hint, FieldRequiredHint, SalutationList, DisplayNameList, FormattedMessage as T, } from '@/components'; import CustomerTypeRadioField from './CustomerTypeRadioField'; import { CLASSES } from '@/constants/classes'; import { inputIntent } from '@/utils'; import { useAutofocus } from '@/hooks'; /** * Customer form primary section. */ export default function CustomerFormPrimarySection({}) { const firstNameFieldRef = useAutofocus(); return (
{/**-----------Customer type. -----------*/} {/**----------- Contact name -----------*/} } inline={true} > {({ form, field: { value }, meta: { error, touched } }) => ( { form.setFieldValue('salutation', salutation.label); }} selectedItem={value} popoverProps={{ minimal: true }} className={classNames( CLASSES.FORM_GROUP_LIST_SELECT, CLASSES.FILL, 'input-group--salutation-list', 'select-list--fill-button', )} /> )} {({ field, meta: { error, touched } }) => ( (firstNameFieldRef.current = ref)} {...field} /> )} {({ field, meta: { error, touched } }) => ( )} {/*----------- Company Name -----------*/} {({ field, meta: { error, touched } }) => ( } intent={inputIntent({ error, touched })} helperText={} inline={true} > )} {/*----------- Display Name -----------*/} {({ form, field: { value }, meta: { error, touched } }) => ( } intent={inputIntent({ error, touched })} label={ <> } className={classNames(CLASSES.FORM_GROUP_LIST_SELECT, CLASSES.FILL)} inline={true} > { form.setFieldValue('display_name', displayName.label); }} selectedItem={value} popoverProps={{ minimal: true }} /> )}
); }