File "block.tsx"

Full Path: /home/warrior1/public_html/wp-content-20241001222009/plugins/woocommerce/packages/woocommerce-blocks/assets/js/blocks/cart/inner-blocks/cart-express-payment-block/block.tsx
File size: 600 bytes
MIME-type: text/x-java
Charset: utf-8

/**
 * External dependencies
 */
import { useStoreCart } from '@woocommerce/base-context/hooks';
import classnames from 'classnames';

/**
 * Internal dependencies
 */
import { CartExpressPayment } from '../../../cart-checkout-shared/payment-methods';

const Block = ( { className }: { className: string } ): JSX.Element | null => {
	const { cartNeedsPayment } = useStoreCart();

	if ( ! cartNeedsPayment ) {
		return null;
	}

	return (
		<div
			className={ classnames(
				'wc-block-cart__payment-options',
				className
			) }
		>
			<CartExpressPayment />
		</div>
	);
};

export default Block;