/** * External dependencies */ import { usePaymentMethods } from '@woocommerce/base-context/hooks'; import { __ } from '@wordpress/i18n'; import Label from '@woocommerce/base-components/label'; import { usePaymentMethodDataContext } from '@woocommerce/base-context'; /** * Internal dependencies */ import NoPaymentMethods from './no-payment-methods'; import PaymentMethodOptions from './payment-method-options'; import SavedPaymentMethodOptions from './saved-payment-method-options'; /** * PaymentMethods component. * * @return {*} The rendered component. */ const PaymentMethods = () => { const { isInitialized, paymentMethods } = usePaymentMethods(); const { customerPaymentMethods } = usePaymentMethodDataContext(); if ( isInitialized && Object.keys( paymentMethods ).length === 0 ) { return ; } return ( <> { Object.keys( customerPaymentMethods ).length > 0 && (