💄 Display account type in connection badge

This commit is contained in:
Philipp Stracker 2025-02-18 14:49:11 +01:00
parent a6868ec0ca
commit 5ce891fe25
No known key found for this signature in database
2 changed files with 13 additions and 4 deletions

View file

@ -27,6 +27,7 @@ const ConnectionStatus = () => {
<ConnectionStatusBadge <ConnectionStatusBadge
isActive={ merchant.isConnected } isActive={ merchant.isConnected }
isSandbox={ merchant.isSandbox } isSandbox={ merchant.isSandbox }
isBusinessSeller={ merchant.isBusinessSeller }
/> />
} }
/> />

View file

@ -5,11 +5,19 @@ import TitleBadge, {
TITLE_BADGE_POSITIVE, TITLE_BADGE_POSITIVE,
} from '../../../../../ReusableComponents/TitleBadge'; } from '../../../../../ReusableComponents/TitleBadge';
const ConnectionStatusBadge = ( { isActive, isSandbox } ) => { const ConnectionStatusBadge = ( { isActive, isSandbox, isBusinessSeller } ) => {
if ( isActive ) { if ( isActive ) {
const label = isSandbox let label;
? __( 'Sandbox Mode', 'woocommerce-paypal-payments' )
: __( 'Active', 'woocommerce-paypal-payments' ); if ( isBusinessSeller ) {
label = isSandbox
? __( 'Business | Sandbox', 'woocommerce-paypal-payments' )
: __( 'Business | Live', 'woocommerce-paypal-payments' );
} else {
label = isSandbox
? __( 'Sandbox', 'woocommerce-paypal-payments' )
: __( 'Active', 'woocommerce-paypal-payments' );
}
return <TitleBadge type={ TITLE_BADGE_POSITIVE } text={ label } />; return <TitleBadge type={ TITLE_BADGE_POSITIVE } text={ label } />;
} }