import React from 'react'; import { useForm } from 'react-hook-form'; import { __ } from '@wordpress/i18n'; import { AppInput, AppSelect } from '../../../../../shared/form'; import { UserType } from '../../../../../services/api.service.types'; export interface RegisterStep2FormData { businessName: string; ownerName: string; category: string; } export interface RegisterStep2Props { businessTypes: Record; userType: UserType; formData?: Partial; onBack: () => void; onSubmit: (data: RegisterStep2FormData) => void; } export function RegisterStep2({ businessTypes, userType, formData, onBack, onSubmit, }: RegisterStep2Props): JSX.Element { const isPartner = userType === 'Partner'; const { register, handleSubmit, formState: { errors }, } = useForm({ defaultValues: { businessName: formData?.businessName || '', category: formData?.category || '', ownerName: formData?.ownerName || '', }, }); const onSubmitForm = (data: RegisterStep2FormData): void => { onSubmit(data); }; return (

{isPartner ? __("Your client's details", 'timetailor-salon-booking') : __('Business details', 'timetailor-salon-booking')}

{isPartner ? __("We'll use these details to set up your client's booking system.", 'timetailor-salon-booking') : __("We'll use these details to set up your booking system.", 'timetailor-salon-booking')}

({ value, label, }))} placeholder="" />
); }