mirror of
https://github.com/woocommerce/woocommerce-paypal-payments.git
synced 2025-09-06 18:16:38 +08:00
23 lines
509 B
JavaScript
23 lines
509 B
JavaScript
import classNames from 'classnames';
|
|
|
|
const Description = ( { children, className = '' } ) => {
|
|
// Don't output anything if description is empty.
|
|
if ( ! children ) {
|
|
return null;
|
|
}
|
|
|
|
const elementClasses = classNames( 'ppcp--description', className );
|
|
|
|
if ( 'string' !== typeof children ) {
|
|
return <span className={ elementClasses }>{ children }</span>;
|
|
}
|
|
|
|
return (
|
|
<span
|
|
className={ elementClasses }
|
|
dangerouslySetInnerHTML={ { __html: children } }
|
|
/>
|
|
);
|
|
};
|
|
|
|
export default Description;
|