woocommerce-paypal-payments/modules/ppcp-settings/resources/js/Components/ReusableComponents/PaymentMethodIcon.js
2025-01-27 10:55:17 +01:00

20 lines
429 B
JavaScript

import { Icon } from '@wordpress/components';
import data from '../../utils/data';
const PaymentMethodIcon = ( { icons, type } ) => {
const validIcon = Array.isArray( icons ) && icons.includes( type );
if ( validIcon || icons === 'all' ) {
return (
<Icon
icon={ data().getImage( 'icon-button-' + type + '.svg' ) }
className="ppcp--method-icon"
/>
);
}
return null;
};
export default PaymentMethodIcon;