woocommerce/plugins/woocommerce-admin/client/tasks/fills/tax/avalara/card.tsx

74 lines
1.7 KiB
TypeScript
Raw Normal View History

/**
* External dependencies
*/
import { __ } from '@wordpress/i18n';
import { getAdminLink } from '@woocommerce/settings';
import interpolateComponents from '@automattic/interpolate-components';
import { recordEvent } from '@woocommerce/tracks';
/**
* Internal dependencies
*/
import { PartnerCard } from '../components/partner-card';
2022-04-21 05:10:56 +00:00
import { TaxChildProps } from '../utils';
import logo from './logo.png';
2022-04-21 05:10:56 +00:00
export const Card: React.FC< TaxChildProps > = ( { task } ) => {
2022-04-21 04:44:19 +00:00
const { additionalData: { avalaraActivated } = {} } = task;
return (
<PartnerCard
name={ __( 'Avalara', 'woocommerce' ) }
logo={ logo }
description={ __( 'Powerful all-in-one tax tool', 'woocommerce' ) }
benefits={ [
__( 'Real-time sales tax calculation', 'woocommerce' ),
interpolateComponents( {
mixedString: __(
'{{strong}}Multi{{/strong}}-economic nexus compliance',
'woocommerce'
),
components: {
strong: <strong />,
},
} ),
__(
'Cross-border and multi-channel compliance',
'woocommerce'
),
__( 'Automate filing & remittance', 'woocommerce' ),
__(
'Return-ready, jurisdiction-level reporting.',
'woocommerce'
),
] }
terms={ '' }
actionText={
avalaraActivated
? __( 'Continue setup', 'woocommerce' )
: __( 'Enable & set up', 'woocommerce' )
}
onClick={ () => {
recordEvent( 'tasklist_tax_select_option', {
selected_option: 'avalara',
} );
if ( avalaraActivated ) {
window.location.href = getAdminLink(
'/admin.php?page=wc-settings&tab=tax&section=avatax'
);
return;
}
window.open(
new URL(
'https://woocommerce.com/products/woocommerce-avatax/'
2022-04-21 04:44:19 +00:00
).toString(),
'_blank'
);
} }
/>
);
};