import React, { useMemo, useCallback } from 'react'; import classNames from 'classnames'; import { FormGroup, Intent, InputGroup, ControlGroup } from '@blueprintjs/core'; import { FormattedMessage as T } from 'react-intl'; import { Hint, FieldRequiredHint, SalutationList, DisplayNameList, ErrorMessage, Row, Col, } from 'components'; import CustomerTypeRadioField from 'containers/Customers/CustomerTypeRadioField'; import { CLASSES } from 'common/classes'; /** * Customer form primary section. */ export default function CustomerFormPrimarySection({ setFieldValue, getFieldProps, errors, values, touched, }) { const handleCustomerTypeCahange = useCallback( (value) => { setFieldValue('customer_type', value); }, [setFieldValue], ); // Handle salutation field select. const handleSalutationSelect = (salutation) => { setFieldValue('salutation', salutation.label); }; // Handle display name field select. const handleDisplayNameSelect = (displayName) => { setFieldValue('display_name', displayName.label); }; return (
{/**-----------Customer type. -----------*/} {/**----------- Contact name -----------*/} } inline={true} > {/*----------- Company Name -----------*/} } intent={errors.company_name && touched.company_name && Intent.DANGER} helperText={ } inline={true} > {/*----------- Display Name -----------*/} } label={ <> } className={classNames(CLASSES.FORM_GROUP_LIST_SELECT, CLASSES.FILL)} inline={true} >
); }