woocommerce/plugins/woocommerce-blocks/assets/js/base/components/cart-checkout/shipping-location/index.tsx

30 lines
590 B
TypeScript
Raw Normal View History

/**
* External dependencies
*/
import { __, sprintf } from '@wordpress/i18n';
interface ShippingLocationProps {
formattedLocation: string | null;
}
// Shows a formatted shipping location.
const ShippingLocation = ( {
formattedLocation,
}: ShippingLocationProps ): JSX.Element | null => {
if ( ! formattedLocation ) {
return null;
}
return (
<span className="wc-block-components-shipping-address">
{ sprintf(
/* translators: %s location. */
__( 'Shipping to %s', 'woocommerce' ),
formattedLocation
) + ' ' }
</span>
);
};
export default ShippingLocation;