/** * External dependencies */ import classnames from 'classnames'; import { getSetting } from '@woocommerce/settings'; import { PlaceOrderButton, ReturnToCartButton, } from '@woocommerce/base-components/cart-checkout'; import { useCheckoutSubmit } from '@woocommerce/base-context/hooks'; import { noticeContexts } from '@woocommerce/base-context'; import { StoreNoticesContainer } from '@woocommerce/blocks-components'; import { applyCheckoutFilter } from '@woocommerce/blocks-checkout'; /** * Internal dependencies */ import { defaultPlaceOrderButtonLabel } from './constants'; import './style.scss'; const Block = ( { cartPageId, showReturnToCart, className, placeOrderButtonLabel, }: { cartPageId: number; showReturnToCart: boolean; className?: string; placeOrderButtonLabel: string; } ): JSX.Element => { const { paymentMethodButtonLabel } = useCheckoutSubmit(); const label = applyCheckoutFilter( { filterName: 'placeOrderButtonLabel', defaultValue: paymentMethodButtonLabel || placeOrderButtonLabel || defaultPlaceOrderButtonLabel, } ); return (
{ showReturnToCart && ( ) }
); }; export default Block;