import Icon from "../utils/Icon"; import { __ } from '@wordpress/i18n'; import DOMPurify from "dompurify"; /** * Render a help notice in the sidebar */ const Help = (props) => { let notice = props.help; if ( !notice.title ){ notice.title = notice.text; notice.text = false; } let openStatus = props.noticesExpanded ? 'open' : ''; //we can use notice.linked_field to create a visual link to the field. let target = notice.url && notice.url.indexOf("complianz.io") !==-1 ? "_blank" : '_self'; return ( <> { notice.title && notice.text &&
{notice.title} {/*some notices contain html, like for the htaccess notices. A title is required for those options, otherwise the text becomes the title. */}
{/* nosemgrep: react-dangerouslysetinnerhtml */} {notice.url &&
{__("More info", "complianz-gdpr")}
}
} { notice.title && !notice.text &&

{notice.title}

} ); } export default Help