2024-10-31 14:44:45 +01:00
import OnboardingHeader from '../../ReusableComponents/OnboardingHeader' ;
import SelectBoxWrapper from '../../ReusableComponents/SelectBoxWrapper' ;
import SelectBox from '../../ReusableComponents/SelectBox' ;
2024-10-23 15:24:52 +02:00
import { _ _ } from '@wordpress/i18n' ;
import PaymentMethodIcons from '../../ReusableComponents/PaymentMethodIcons' ;
2024-11-20 16:56:44 +01:00
import { OnboardingHooks , BUSINESS _TYPES } from '../../../data' ;
2024-10-30 17:02:01 +01:00
const BUSINESS _RADIO _GROUP _NAME = 'business' ;
2024-10-24 06:35:48 +02:00
2024-10-28 18:27:12 +01:00
const StepBusiness = ( {
setStep ,
currentStep ,
stepperOrder ,
setCompleted ,
} ) => {
2024-11-20 16:56:44 +01:00
const { isCasualSeller , setIsCasualSeller } = OnboardingHooks . useBusiness ( ) ;
2024-10-30 17:33:48 +01:00
const handleSellerTypeChange = ( value ) => {
setIsCasualSeller ( BUSINESS _TYPES . CASUAL _SELLER === value ) ;
} ;
const getCurrentValue = ( ) => {
if ( isCasualSeller === null ) {
return '' ;
}
return isCasualSeller
? BUSINESS _TYPES . CASUAL _SELLER
: BUSINESS _TYPES . BUSINESS ;
} ;
2024-10-23 15:24:52 +02:00
return (
2024-10-24 06:35:48 +02:00
< div className = "ppcp-r-page-business" >
2024-10-23 15:24:52 +02:00
< OnboardingHeader
title = { _ _ (
2024-11-19 16:43:00 -04:00
'Choose your account type' ,
2024-10-23 15:24:52 +02:00
'woocommerce-paypal-payments'
) }
/ >
< div className = "ppcp-r-inner-container" >
< SelectBoxWrapper >
2024-11-19 16:43:00 -04:00
< SelectBox
title = { _ _ (
'Business' ,
'woocommerce-paypal-payments'
) }
description = { _ _ (
'Recommended for individuals and organizations that primarily use PayPal to sell goods or services or receive donations, even if your business is not incorporated.' ,
'woocommerce-paypal-payments'
) }
name = { BUSINESS _RADIO _GROUP _NAME }
value = { BUSINESS _TYPES . BUSINESS }
changeCallback = { handleSellerTypeChange }
currentValue = { getCurrentValue ( ) }
checked = { isCasualSeller === false }
type = "radio"
>
< / S e l e c t B o x >
2024-10-23 15:24:52 +02:00
< SelectBox
title = { _ _ (
2024-11-19 16:43:00 -04:00
'Personal Account' ,
2024-10-23 15:24:52 +02:00
'woocommerce-paypal-payments'
) }
description = { _ _ (
2024-11-19 16:43:00 -04:00
'Ideal for those who primarily make purchases or send personal transactions to family and friends.' ,
2024-10-23 15:24:52 +02:00
'woocommerce-paypal-payments'
) }
2024-10-24 06:35:48 +02:00
name = { BUSINESS _RADIO _GROUP _NAME }
2024-10-30 17:02:01 +01:00
value = { BUSINESS _TYPES . CASUAL _SELLER }
2024-10-30 17:33:48 +01:00
changeCallback = { handleSellerTypeChange }
currentValue = { getCurrentValue ( ) }
checked = { isCasualSeller === true }
2024-10-24 13:54:50 +02:00
type = "radio"
2024-10-23 15:24:52 +02:00
>
< / S e l e c t B o x >
< / S e l e c t B o x W r a p p e r >
< / d i v >
< / d i v >
) ;
} ;
export default StepBusiness ;