woocommerce-paypal-payments/modules/ppcp-settings/resources/js/Components/ReusableComponents/Elements/Description.js
2025-01-21 18:57:36 +01:00

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;