<commit_before>import React, { useEffect, useState } from "react";
import classes from "./SelectCompetition.module.css";
import CompetitionCard from "../../components/CompetitionCard/CompetitionCard";
import LinkButton from "../../components/UI/LinkButton/LinkButton";
import { useHorizontalScroll } from "../../components/UI/UIActions/useHorizontalScroll";

const SelectCompetition = (props) => {
  const scrollRef = useHorizontalScroll();

  const userId = 1;
  const [comps, setComps] = useState(null);

  const competitionSelectedHandler = (compId) => {
    console.log("Storing" + compId);
    localStorage.setItem("compId", compId);
    props.compIdChanged(compId);
  };

  const renderCompCards = (compsList) => {
    if (compsList.length === 0) {
      setComps(
        <p className={classes.NoCompetition}>
          You are not currently enrolled in any competitions... D:
        </p>
      );
      return;
    }
    setComps(
      compsList.map((comp) => {
        return (
          <CompetitionCard
            key={comp.id}
            id={comp.id}
            name={comp.competitionName}
            organiser={comp.organiserName}
            organiserLdap={comp.organiserIdap}
            startDate={comp.startDate}
            endDate={comp.endDate}
            rank={comp.user.rank}
            rankYesterday={comp.user.rankYesterday}
            netWorth={comp.user.netWorth}
            currentlyAvailable={comp.user.amountAvailable}
            onCompSelect={competitionSelectedHandler}
          ></CompetitionCard>
        );
      })
    );
  };

  useEffect(() => {
    fetch("./competitionInfo?user=" + userId)
      .then((response) => response.json())
      .then((data) => {<commit_msg>Change you are to you're<commit_after>import React, { useEffect, useState } from "react";
import classes from "./SelectCompetition.module.css";
import CompetitionCard from "../../components/CompetitionCard/CompetitionCard";
import LinkButton from "../../components/UI/LinkButton/LinkButton";
import { useHorizontalScroll } from "../../components/UI/UIActions/useHorizontalScroll";

const SelectCompetition = (props) => {
  const scrollRef = useHorizontalScroll();

  const userId = 1;
  const [comps, setComps] = useState(null);

  const competitionSelectedHandler = (compId) => {
    console.log("Storing" + compId);
    localStorage.setItem("compId", compId);
    props.compIdChanged(compId);
  };

  const renderCompCards = (compsList) => {
    if (compsList.length === 0) {
      setComps(
        <p className={classes.NoCompetition}>
          You're not currently enrolled in any competitions... D:
        </p>
      );
      return;
    }
    setComps(
      compsList.map((comp) => {
        return (
          <CompetitionCard
            key={comp.id}
            id={comp.id}
            name={comp.competitionName}
            organiser={comp.organiserName}
            organiserLdap={comp.organiserIdap}
            startDate={comp.startDate}
            endDate={comp.endDate}
            rank={comp.user.rank}
            rankYesterday={comp.user.rankYesterday}
            netWorth={comp.user.netWorth}
            currentlyAvailable={comp.user.amountAvailable}
            onCompSelect={competitionSelectedHandler}
          ></CompetitionCard>
        );
      })
    );
  };

  useEffect(() => {
    fetch("./competitionInfo?user=" + userId)
      .then((response) => response.json())
      .then((data) => {
{'fraction_non_alphanumeric': 0.1368909512761021, 'fraction_numerical': 0.001160092807424594, 'mean_word_length': 2.56301652892562, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 25, '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': '2562534', 'n_tokens_mistral': 1002, 'n_tokens_neox': 979, 'n_words': 175}