<commit_before>import React, { PropsWithChildren } from 'react';
import Markdown from 'markdown-to-jsx';

import IsFranceConnected from '../isFranceConnected';
import { ButtonLink, ExternalLink, RichLink } from '../../uiComponents';
import Quote from '../../uiComponents/quote';
import TeamHelpWidget from '../teamHelpWidget';
import ApiRnaWidget from '../apiWidgets/apiRna';
import ApiSireneWidget from '../apiWidgets/apiSirene';
import DatagouvWidget from '../widgets/datagouv';
import FlatFileWidget from '../widgets/flatFile';
import { H2WithAnchor, H3WithAnchor } from '../../uiComponents/titleWithAnchor';

const CenteredCta: React.FC<PropsWithChildren<{ href: string }>> = props => (
  <div className="layout-center">
    <ButtonLink href={props.href} size="large">
      {props.children}
    </ButtonLink>
    <style jsx>{`
      .layout-center {
        padding: 10px 0;
      }
    `}</style>
  </div>
);

const Centered: React.FC<PropsWithChildren<{}>> = props => (
  <div className="layout-center">{props.children}</div>
);

const Grid: React.FC<PropsWithChildren<{}>> = props => (
  <div className="default-grid">{props.children}</div>
);

const NextSteps = ({
  is_editeur = false,
  service_description = `de la description du service justifiant une simplication pour les citoyens`,
}) => (
  <>
    <p>
      <b>Pour remplir votre demande, vous aurez besoin : </b>
    </p>
    <ul>
      <li>de votre numéro SIRET</li>
      <li>du cadre juridique</li>
      <li>{service_description}</li>
      <li>des coordonnées de l'équipe</li>
      <li>
        des coordonnées de votre délégué à la protection des données et
        responsable de traitement
        {is_editeur && <b> de l’entité pour laquelle vous opérez</b>}
      </li>
    </ul>
  </>
);

const RichReactMarkdown: React.FC<{ source: string; addAnchor?: boolean }> = ({
  source,
}) => (
  <Markdown
    children={source}
    options={{
      overrides: {
        Button: CenteredCta,
        NextSteps: NextSteps,
        External: ExternalLink,
        IsFranceConnected: IsFranceConnected,
        Quote: Quote,
        RichLink: RichLink,
        Grid: Grid,
        Centered: Centered,
        ContactUs: TeamHelpWidget,
        ApiRnaWidget: ApiRnaWidget,
        FlatFile: FlatFileWidget,
        ApiSireneWidget: ApiSireneWidget,
        Datagouv: DatagouvWidget,
        h2: H2WithAnchor,
        h3: H3WithAnchor,
      },
    }}
  />
);

export default RichReactMarkdown;
<commit_msg>typo in NextSteps<commit_after>import React, { PropsWithChildren } from 'react';
import Markdown from 'markdown-to-jsx';

import IsFranceConnected from '../isFranceConnected';
import { ButtonLink, ExternalLink, RichLink } from '../../uiComponents';
import Quote from '../../uiComponents/quote';
import TeamHelpWidget from '../teamHelpWidget';
import ApiRnaWidget from '../apiWidgets/apiRna';
import ApiSireneWidget from '../apiWidgets/apiSirene';
import DatagouvWidget from '../widgets/datagouv';
import FlatFileWidget from '../widgets/flatFile';
import { H2WithAnchor, H3WithAnchor } from '../../uiComponents/titleWithAnchor';

const CenteredCta: React.FC<PropsWithChildren<{ href: string }>> = props => (
  <div className="layout-center">
    <ButtonLink href={props.href} size="large">
      {props.children}
    </ButtonLink>
    <style jsx>{`
      .layout-center {
        padding: 10px 0;
      }
    `}</style>
  </div>
);

const Centered: React.FC<PropsWithChildren<{}>> = props => (
  <div className="layout-center">{props.children}</div>
);

const Grid: React.FC<PropsWithChildren<{}>> = props => (
  <div className="default-grid">{props.children}</div>
);

const NextSteps = ({
  is_editeur = false,
  service_description = `de la description du service justifiant une simplification pour les citoyens`,
}) => (
  <>
    <p>
      <b>Pour remplir votre demande, vous aurez besoin : </b>
    </p>
    <ul>
      <li>de votre numéro SIRET</li>
      <li>du cadre juridique</li>
      <li>{service_description}</li>
      <li>des coordonnées de l'équipe</li>
      <li>
        des coordonnées de votre délégué à la protection des données et
        responsable de traitement
        {is_editeur && <b> de l’entité pour laquelle vous opérez</b>}
      </li>
    </ul>
  </>
);

const RichReactMarkdown: React.FC<{ source: string; addAnchor?: boolean }> = ({
  source,
}) => (
  <Markdown
    children={source}
    options={{
      overrides: {
        Button: CenteredCta,
        NextSteps: NextSteps,
        External: ExternalLink,
        IsFranceConnected: IsFranceConnected,
        Quote: Quote,
        RichLink: RichLink,
        Grid: Grid,
        Centered: Centered,
        ContactUs: TeamHelpWidget,
        ApiRnaWidget: ApiRnaWidget,
        FlatFile: FlatFileWidget,
        ApiSireneWidget: ApiSireneWidget,
        Datagouv: DatagouvWidget,
        h2: H2WithAnchor,
        h3: H3WithAnchor,
      },
    }}
  />
);

export default RichReactMarkdown;

{'fraction_non_alphanumeric': 0.13685910375454177, 'fraction_numerical': 0.0036334275333064193, 'mean_word_length': 3.091659785301404, 'pattern_counts': {'":': 0, '<': 79, '<?xml version=': 0, '>': 89, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3417368', 'n_tokens_mistral': 1628, 'n_tokens_neox': 1607, 'n_words': 382}