woocommerce-paypal-payments/modules/ppcp-settings/resources/js/Components/ReusableComponents/PaymentMethodIcon.js

21 lines
429 B
JavaScript
Raw Normal View History

import { Icon } from '@wordpress/components';
2024-10-23 08:56:47 +02:00
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"
/>
);
2024-10-23 08:56:47 +02:00
}
return null;
2024-10-23 08:56:47 +02:00
};
export default PaymentMethodIcon;