import React from 'react'; import { StepProps } from './types'; import { SectionHeader, FieldRow, Field, Label, Input, SubSectionLabel, CheckboxGroup, CheckboxLabel, CheckboxWrapper, CheckboxInput, AppointmentFields, TimeSelectRow, TimeSeparator } from './styles'; import { FormField } from './FormField'; import { CheckmarkSvg } from './CheckmarkSvg'; import { CustomSelect } from './CustomSelect'; import { HOUR_OPTIONS, MINUTE_OPTIONS } from './constants'; export const PersonalDetailsStep: React.FC = ({ isApp, formData, errors, updateField }) => { const showAppointmentFields = formData.appointmentVideoCall || formData.appointmentTelephoneCall; return ( <> Your details How would you like us to contact you? updateField( 'contactByTelephone', !formData.contactByTelephone ) } /> {formData.contactByTelephone && } Telephone updateField('contactByEmail', !formData.contactByEmail) } /> {formData.contactByEmail && } Email Or book an appointment? updateField( 'appointmentVideoCall', !formData.appointmentVideoCall ) } /> {formData.appointmentVideoCall && } Video call updateField( 'appointmentTelephoneCall', !formData.appointmentTelephoneCall ) } /> {formData.appointmentTelephoneCall && } Telephone call {showAppointmentFields && ( updateField('preferredDate', e.target.value)} isApp={isApp} /> { const [, mins = '00'] = (formData.preferredTime || '').split( ':' ); updateField('preferredTime', `${val}:${mins}`); }} isApp={isApp} /> : { const [hrs = '00'] = (formData.preferredTime || '').split( ':' ); updateField('preferredTime', `${hrs}:${val}`); }} isApp={isApp} /> )} ); };