<commit_before>import PropTypes from "prop-types";
import React from "react";
import styled from "styled-components";

import style from "@agir/front/genericComponents/_variables.scss";

import ShareCard from "@agir/front/genericComponents/ShareCard";

import GroupLocation from "@agir/groups/groupPage/GroupLocation";
import GroupContactCard from "@agir/groups/groupPage/GroupContactCard";
import GroupDescription from "@agir/groups/groupPage/GroupDescription";
import GroupLinks from "@agir/groups/groupPage/GroupLinks";
import GroupFacts from "@agir/groups/groupPage/GroupFacts";
import GroupDonation from "@agir/groups/groupPage/GroupDonation";
import GroupSuggestions from "@agir/groups/groupPage/GroupSuggestions";
import GroupEventList from "@agir/groups/groupPage/GroupEventList";
import GroupOrders from "@agir/groups/groupPage/GroupOrders";

const Agenda = styled.div`
  margin: 0;
  padding: 1.5rem 1rem;
  height: 316px;
  background: ${style.black25};

  & > h3 {
    margin-top: 0;
    margin-bottom: 1rem;
  }
`;

const InfoRoute = ({
  upcomingEvents,
  goToAgendaTab,
  group,
  groupSuggestions,
}) => (
  <>
    {Array.isArray(upcomingEvents) && upcomingEvents.length > 0 ? (
      <Agenda>
        <h3>Agenda</h3>
        <GroupEventList
          events={[upcomingEvents[0]]}
          loadMore={goToAgendaTab}
          loadMoreLabel="Voir tout l'agenda"
        />
      </Agenda>
    ) : null}

    <GroupContactCard {...group} />
    <GroupOrders {...group} />
    <GroupDescription {...group} />
    <GroupLinks {...group} />
    <GroupFacts {...group} />
    <GroupLocation {...group} />
    {group.routes && group.routes.donations && (
      <GroupDonation url={group.routes.donations} />
    )}
    <ShareCard title="Partager le lien du groupe" />

    {Array.isArray(groupSuggestions) && groupSuggestions.length > 0 ? (
      <div style={{ paddingTop: "2rem" }}>
        <GroupSuggestions groups={groupSuggestions} />
      </div>
    ) : null}
  </>
);
InfoRoute.propTypes = {
  group: PropTypes.shape({
    isMember: PropTypes.bool,
    isManager: PropTypes.bool,<commit_msg>feat: refactor GroupPage InfoRoute Agenda block<commit_after>import PropTypes from "prop-types";
import React from "react";
import styled from "styled-components";

import style from "@agir/front/genericComponents/_variables.scss";

import ShareCard from "@agir/front/genericComponents/ShareCard";
import { RawFeatherIcon } from "@agir/front/genericComponents/FeatherIcon";

import GroupLocation from "@agir/groups/groupPage/GroupLocation";
import GroupContactCard from "@agir/groups/groupPage/GroupContactCard";
import GroupDescription from "@agir/groups/groupPage/GroupDescription";
import GroupLinks from "@agir/groups/groupPage/GroupLinks";
import GroupFacts from "@agir/groups/groupPage/GroupFacts";
import GroupDonation from "@agir/groups/groupPage/GroupDonation";
import GroupSuggestions from "@agir/groups/groupPage/GroupSuggestions";
import GroupEventList from "@agir/groups/groupPage/GroupEventList";
import GroupOrders from "@agir/groups/groupPage/GroupOrders";

const Agenda = styled.div`
  margin: 0;
  padding: 1.5rem 1rem 0;
  background: ${style.black25};

  & > h3 {
    margin-top: 0;
    margin-bottom: 1rem;
    display: flex;
    flex-flow: row nowrap;
    align-items: center;
    font-size: 1rem;
    font-weight: 600;

    button {
      background: none;
      border: none;
      outline: none;
      display: flex;
      flex-flow: row nowrap;
      align-items: center;
      margin-left: auto;
      padding: 0;
      color: ${style.primary500};
      font-weight: inherit;
      font-size: inherit;

      &:hover,
      &:focus {
        text-decoration: underline;
        cursor: pointer;
      }

      & > * {
        flex: 0 0 auto;
      }

      ${RawFeatherIcon} {
        margin-left: 0.5rem;
        margin-top: 1px;
      }
    }
  }
`;

const InfoRoute = ({
  upcomingEvents,
  goToAgendaTab,
  group,
  groupSuggestions,
}) => (
  <>
    {Array.isArray(upcomingEvents) && upcomingEvents.length > 0 ? (
      <Agenda>
        <h3>
          <span>À venir</span>
          <button onClick={goToAgendaTab}>
            Voir tout l'agenda{" "}
            <RawFeatherIcon
              name="arrow-right"
              width="1rem"
              height="1rem"
              strokeWidth="3"
            />
          </button>
        </h3>
        <GroupEventList events={[upcomingEvents[0]]} />
      </Agenda>
    ) : null}

    <GroupContactCard {...group} />
    <GroupOrders {...group} />
    <GroupDescription {...group} />
    <GroupLinks {...group} />
    <GroupFacts {...group} />
    <GroupLocation {...group} />
    {group.routes && group.routes.donations && (
      <GroupDonation url={group.routes.donations} />
    )}
    <ShareCard title="Partager le lien du groupe" />

    {Array.isArray(groupSuggestions) && groupSuggestions.length > 0 ? (
      <div style={{ paddingTop: "2rem" }}>
        <GroupSuggestions groups={groupSuggestions} />
      </div>
    ) : null}
  </>
);
InfoRoute.propTypes = {
  group: PropTypes.shape({
    isMember: PropTypes.bool,
    isManager: PropTypes.bool,
{'fraction_non_alphanumeric': 0.13730821518741504, 'fraction_numerical': 0.009710623422023694, 'mean_word_length': 3.0140296180826187, 'pattern_counts': {'":': 0, '<': 44, '<?xml version=': 0, '>': 53, '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': '6270939', 'n_tokens_mistral': 1658, 'n_tokens_neox': 1621, 'n_words': 331}