// Here be dragons... /* eslint-disable react/no-danger */ import { flatMap, map } from 'lodash'; import { renderToStaticMarkup } from 'react-dom/server.browser'; /** * Constants */ const JQUERY_URL = 'https://s0.wp.com/wp-includes/js/jquery/jquery.js'; export default function generateEmbedFrameMarkup( { body, scripts, styles } = {} ) { if ( ! body && ! scripts && ! styles ) { return ''; } return renderToStaticMarkup( // eslint-disable-next-line jsx-a11y/html-has-lang -- this is an embed frame, not the main document.
{ map( styles, ( { media, src }, key ) => ( ) ) } { /* Many embed/shortcode scripts assume jQuery is already defined */ } { flatMap( scripts, ( { extra, src }, key ) => { return [ extra ? ( ) : null, , ]; } ) } ); }