mirror of
https://github.com/woocommerce/woocommerce-paypal-payments.git
synced 2025-08-30 05:00:51 +08:00
26 lines
527 B
JavaScript
26 lines
527 B
JavaScript
import classNames from 'classnames';
|
|
|
|
const Description = ( { children, asHtml = false, className = '' } ) => {
|
|
// Don't output anything if description is empty.
|
|
if ( ! children ) {
|
|
return null;
|
|
}
|
|
|
|
const elementClasses = classNames(
|
|
'ppcp-r-settings-block__description',
|
|
className
|
|
);
|
|
|
|
if ( ! asHtml ) {
|
|
return <span className={ elementClasses }>{ children }</span>;
|
|
}
|
|
|
|
return (
|
|
<span
|
|
className={ elementClasses }
|
|
dangerouslySetInnerHTML={ { __html: children } }
|
|
/>
|
|
);
|
|
};
|
|
|
|
export default Description;
|