mirror of
https://gh.wpcy.net/https://github.com/woocommerce/woocommerce-paypal-payments.git
synced 2026-05-01 04:52:18 +08:00
28 lines
735 B
JavaScript
28 lines
735 B
JavaScript
import { __ } from '@wordpress/i18n';
|
|
|
|
/**
|
|
* Renders a button to change the shipping address.
|
|
*
|
|
* @param {Object} props
|
|
* @param {Function} props.onChangeShippingAddressClick - Callback function to handle the click event.
|
|
* @return {JSX.Element} The rendered button as an anchor tag.
|
|
*/
|
|
const ShippingChangeButton = ( { onChangeShippingAddressClick } ) => (
|
|
<a
|
|
className="wc-block-axo-change-link"
|
|
role="button"
|
|
onClick={ ( event ) => {
|
|
// Prevent default anchor behavior
|
|
event.preventDefault();
|
|
// Call the provided click handler
|
|
onChangeShippingAddressClick();
|
|
} }
|
|
>
|
|
{ __(
|
|
'Choose a different shipping address',
|
|
'woocommerce-paypal-payments'
|
|
) }
|
|
</a>
|
|
);
|
|
|
|
export default ShippingChangeButton;
|