
(function registerFreeSeoInternalLinkSuggestions(global) {
  const React = global.React;
  if (!React) return;

  function InternalLinkSuggestions(props) {
    const links = props.links || [];
    if (!links.length) return <div className="free-seo-empty">No internal link suggestions yet.</div>;
    return <div className="free-seo-table-wrap"><table className="free-seo-table"><thead><tr><th>Source page</th><th>Anchor</th><th>Placement</th><th>Score</th></tr></thead><tbody>
      {links.map((link) => <tr key={link.id}><td><a href={link.sourceUrl} target="_blank" rel="noreferrer">{link.sourceTitle || link.sourceUrl}</a><p>{link.rationale}</p></td><td>{link.suggestedAnchor}</td><td>{link.placement}</td><td>{Math.round((link.score || 0) * 100)}</td></tr>)}
    </tbody></table></div>;
  }

  global.FreeSeoInternalLinkSuggestions = InternalLinkSuggestions;
})(window);
