2021-11-02 17:33:42 +00:00
|
|
|
/**
|
|
|
|
* External dependencies
|
|
|
|
*/
|
|
|
|
import { __ } from '@wordpress/i18n';
|
|
|
|
import { Button } from '@wordpress/components';
|
2022-02-21 02:34:25 +00:00
|
|
|
import interpolateComponents from '@automattic/interpolate-components';
|
2021-11-02 17:33:42 +00:00
|
|
|
import { H } from '@woocommerce/components';
|
|
|
|
import { recordEvent } from '@woocommerce/tracks';
|
|
|
|
|
2021-11-05 20:32:02 +00:00
|
|
|
/**
|
|
|
|
* Internal dependencies
|
|
|
|
*/
|
|
|
|
import { SetupStepProps } from './setup';
|
|
|
|
|
2022-04-21 05:10:56 +00:00
|
|
|
export const AutomatedTaxes: React.FC<
|
|
|
|
Pick<
|
|
|
|
SetupStepProps,
|
|
|
|
'isPending' | 'onAutomate' | 'onManual' | 'onDisable'
|
|
|
|
>
|
|
|
|
> = ( { isPending, onAutomate, onManual, onDisable } ) => {
|
2021-11-02 17:33:42 +00:00
|
|
|
return (
|
|
|
|
<div className="woocommerce-task-tax__success">
|
|
|
|
<span
|
|
|
|
className="woocommerce-task-tax__success-icon"
|
|
|
|
role="img"
|
|
|
|
aria-labelledby="woocommerce-task-tax__success-message"
|
|
|
|
>
|
|
|
|
🎊
|
|
|
|
</span>
|
|
|
|
<H id="woocommerce-task-tax__success-message">
|
2022-03-30 09:00:04 +00:00
|
|
|
{ __( 'Good news!', 'woocommerce' ) }
|
2021-11-02 17:33:42 +00:00
|
|
|
</H>
|
|
|
|
<p>
|
|
|
|
{ interpolateComponents( {
|
|
|
|
mixedString: __(
|
|
|
|
'{{strong}}Jetpack{{/strong}} and {{strong}}WooCommerce Tax{{/strong}} ' +
|
|
|
|
'can automate your sales tax calculations for you.',
|
2022-03-30 09:00:04 +00:00
|
|
|
'woocommerce'
|
2021-11-02 17:33:42 +00:00
|
|
|
),
|
|
|
|
components: {
|
|
|
|
strong: <strong />,
|
|
|
|
},
|
|
|
|
} ) }
|
|
|
|
</p>
|
|
|
|
<Button
|
|
|
|
isPrimary
|
|
|
|
isBusy={ isPending }
|
|
|
|
onClick={ () => {
|
|
|
|
recordEvent( 'tasklist_tax_setup_automated_proceed', {
|
|
|
|
setup_automatically: true,
|
|
|
|
} );
|
|
|
|
onAutomate();
|
|
|
|
} }
|
|
|
|
>
|
2022-03-30 09:00:04 +00:00
|
|
|
{ __( 'Yes please', 'woocommerce' ) }
|
2021-11-02 17:33:42 +00:00
|
|
|
</Button>
|
|
|
|
<Button
|
|
|
|
disabled={ isPending }
|
|
|
|
isTertiary
|
|
|
|
onClick={ () => {
|
|
|
|
recordEvent( 'tasklist_tax_setup_automated_proceed', {
|
|
|
|
setup_automatically: false,
|
|
|
|
} );
|
|
|
|
onManual();
|
|
|
|
} }
|
|
|
|
>
|
2022-03-30 09:00:04 +00:00
|
|
|
{ __( "No thanks, I'll set up manually", 'woocommerce' ) }
|
2021-11-02 17:33:42 +00:00
|
|
|
</Button>
|
|
|
|
<Button disabled={ isPending } isTertiary onClick={ onDisable }>
|
2022-03-30 09:00:04 +00:00
|
|
|
{ __( "I don't charge sales tax", 'woocommerce' ) }
|
2021-11-02 17:33:42 +00:00
|
|
|
</Button>
|
|
|
|
</div>
|
|
|
|
);
|
|
|
|
};
|