<commit_before>import React from 'react';
import { connect } from 'react-redux';
import { translate, Interpolate } from 'react-i18next';
import { flow } from 'lodash/fp';
import { Link } from 'react-router';

import * as deps from '../../deps';
import Icon from '../../elements/Icon';
import Button from '../../elements/Button';

/* Error Message */
let Message = ({ checkType, color, t, site }) => {
  let ErrorMessageBody;
  let linkToHelp = 'https://docs.worona.org/dashboard/getting-started/troubleshooting.html';
  if (checkType === 'online') {
    linkToHelp += '#1-your-site-is-not-online-or-available';
    ErrorMessageBody = () => (
      <div className="content">
        {t('check-error-online-body')}
        <br />
        <ul>
          <li>
            {t('check-error-online-body-isup')}
          </li>
          <br />
          <li>
            <Interpolate
              i18nKey="check-error-online-body-iscorrect"
              value={<strong>{site.url}</strong>}
            /></li>
        </ul>
        <br />
        <div className="has-text-centered">
          <Link className="button is-danger is-medium" to={`/edit-site/${site.id}`}>
            <span className="icon is-small">
              <i className="fa fa-refresh" aria-hidden="true" />
            </span>
            <span>
              {t('check-edit-url-text')}
            </span>
          </Link>
          <br /><br />
          or
        </div>
      </div>
    );
  } else if (checkType === 'plugin') {
    let linkToDownLoadPlugin = site.url;
    linkToDownLoadPlugin += '/wp-admin/plugin-install.php?tab=plugin-information&plugin=worona';

    linkToHelp += '#2-woronas-plugin-is-missing';

    ErrorMessageBody = () => (
      <div className="content">
        <Interpolate
          i18nKey="check-error-plugin-body"
          useDangerouslySetInnerHTML
        />
        <br /><br />
        <div className="has-text-centered">
          <a
            className="button is-danger is-medium"
            href={linkToDownLoadPlugin}
            target="_blank" rel="noopener noreferrer"
          >
            <span className="icon is-small">
              <i className="fa fa-check" aria-hidden="true" />
            </span>
            <span>
              &nbsp;Install Worona Plugin
            </span>
          </a>
          <br /><br />
          or
        </div>
      </div>
    );
  }
  return (
    <article className={`message is-${color}`}>
      <div className="message-header">
        <strong>{t(`check-error-${checkType}-header`)}</strong>
      </div>
      <div className="message-body">
        <ErrorMessageBody />
        <div className="has-text-centered">
          <a
            className="button is-danger is-outlined"
            href={linkToHelp} target="_blank" rel="noopener noreferrer"
          >
            <span className="icon is-small"><commit_msg>changed icon in download plugin button.<commit_after>import React from 'react';
import { connect } from 'react-redux';
import { translate, Interpolate } from 'react-i18next';
import { flow } from 'lodash/fp';
import { Link } from 'react-router';

import * as deps from '../../deps';
import Icon from '../../elements/Icon';
import Button from '../../elements/Button';

/* Error Message */
let Message = ({ checkType, color, t, site }) => {
  let ErrorMessageBody;
  let linkToHelp = 'https://docs.worona.org/dashboard/getting-started/troubleshooting.html';
  if (checkType === 'online') {
    linkToHelp += '#1-your-site-is-not-online-or-available';
    ErrorMessageBody = () => (
      <div className="content">
        {t('check-error-online-body')}
        <br />
        <ul>
          <li>
            {t('check-error-online-body-isup')}
          </li>
          <br />
          <li>
            <Interpolate
              i18nKey="check-error-online-body-iscorrect"
              value={<strong>{site.url}</strong>}
            /></li>
        </ul>
        <br />
        <div className="has-text-centered">
          <Link className="button is-danger is-medium" to={`/edit-site/${site.id}`}>
            <span className="icon is-small">
              <i className="fa fa-refresh" aria-hidden="true" />
            </span>
            <span>
              {t('check-edit-url-text')}
            </span>
          </Link>
          <br /><br />
          or
        </div>
      </div>
    );
  } else if (checkType === 'plugin') {
    let linkToDownLoadPlugin = site.url;
    linkToDownLoadPlugin += '/wp-admin/plugin-install.php?tab=plugin-information&plugin=worona';

    linkToHelp += '#2-woronas-plugin-is-missing';

    ErrorMessageBody = () => (
      <div className="content">
        <Interpolate
          i18nKey="check-error-plugin-body"
          useDangerouslySetInnerHTML
        />
        <br /><br />
        <div className="has-text-centered">
          <a
            className="button is-danger is-medium"
            href={linkToDownLoadPlugin}
            target="_blank" rel="noopener noreferrer"
          >
            <span className="icon is-small">
              <i className="fa fa-download" aria-hidden="true" />
            </span>
            <span>
              &nbsp;Install Worona Plugin
            </span>
          </a>
          <br /><br />
          or
        </div>
      </div>
    );
  }
  return (
    <article className={`message is-${color}`}>
      <div className="message-header">
        <strong>{t(`check-error-${checkType}-header`)}</strong>
      </div>
      <div className="message-body">
        <ErrorMessageBody />
        <div className="has-text-centered">
          <a
            className="button is-danger is-outlined"
            href={linkToHelp} target="_blank" rel="noopener noreferrer"
          >
            <span className="icon is-small">
{'fraction_non_alphanumeric': 0.16222260450713918, 'fraction_numerical': 0.0027524514020299327, 'mean_word_length': 1.851397743992153, 'pattern_counts': {'":': 0, '<': 105, '<?xml version=': 0, '>': 111, 'https://': 2, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2658309', 'n_tokens_mistral': 1755, 'n_tokens_neox': 1726, 'n_words': 334}