<commit_before>import React from 'react';
import TopMenu from './TopMenu';

const Header = ({ path, page, user, isAdmin, competitions, selectedCompetition, handleCompetitionSelect, onReloadData, text }) => (
    <>
        {
            // Show the top menu, profile pic and reload data button on every page but the Login page.
            page !== 'Log In' &&
            <>
                <TopMenu
                    path={path}
                    user={user}
                    competitions={competitions}
                    selectedCompetition={selectedCompetition}
                    handleCompetitionSelect={handleCompetitionSelect}
                    isAdmin={isAdmin}
                />
                <img className="profile-pic" src={'pics/' + user.image} alt="profile-pic" title={`${user.name.first} ${user.name.last}`} />
                <button className="reload-btn" onClick={onReloadData}>
                    <span className="icon-reload" />
                </button>
            </>
        }
        <h2>
            Spring Racing Tipping <img src="horse.png" alt="Title logo" />
            <span className="beta">BETA</span>
        </h2>
        {
            // Show the competition name on every page but the Login page, and if the selectedCompetition is set.
            page !== 'Log In' && selectedCompetition &&
            <span className="comp-name">{selectedCompetition.name}</span>
        }
        <h3>{page}</h3>
        <p>{text}</p>
    </>
);

const areEqual = (prevProps, nextProps) => {
    return nextProps.page === prevProps.page &&
           (prevProps.user && nextProps.user.name.first === prevProps.user.name.first) &&
           (prevProps.user && nextProps.user.name.last === prevProps.user.name.last) &&
           nextProps.isAdmin === prevProps.isAdmin &&<commit_msg>Add title to data reload button.<commit_after>import React from 'react';
import TopMenu from './TopMenu';

const Header = ({ path, page, user, isAdmin, competitions, selectedCompetition, handleCompetitionSelect, onReloadData, text }) => (
    <>
        {
            // Show the top menu, profile pic and reload data button on every page but the Login page.
            page !== 'Log In' &&
            <>
                <TopMenu
                    path={path}
                    user={user}
                    competitions={competitions}
                    selectedCompetition={selectedCompetition}
                    handleCompetitionSelect={handleCompetitionSelect}
                    isAdmin={isAdmin}
                />
                <img className="profile-pic" src={'pics/' + user.image} alt="profile-pic" title={`${user.name.first} ${user.name.last}`} />
                <button className="reload-btn" title="Reload data" onClick={onReloadData}>
                    <span className="icon-reload" />
                </button>
            </>
        }
        <h2>
            Spring Racing Tipping <img src="horse.png" alt="Title logo" />
            <span className="beta">BETA</span>
        </h2>
        {
            // Show the competition name on every page but the Login page, and if the selectedCompetition is set.
            page !== 'Log In' && selectedCompetition &&
            <span className="comp-name">{selectedCompetition.name}</span>
        }
        <h3>{page}</h3>
        <p>{text}</p>
    </>
);

const areEqual = (prevProps, nextProps) => {
    return nextProps.page === prevProps.page &&
           (prevProps.user && nextProps.user.name.first === prevProps.user.name.first) &&
           (prevProps.user && nextProps.user.name.last === prevProps.user.name.last) &&
           nextProps.isAdmin === prevProps.isAdmin &&
{'fraction_non_alphanumeric': 0.13282732447817835, 'fraction_numerical': 0.002168609379235565, 'mean_word_length': 1.8715953307392996, 'pattern_counts': {'":': 0, '<': 43, '<?xml version=': 0, '>': 47, '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': '1277194', 'n_tokens_mistral': 1007, 'n_tokens_neox': 961, 'n_words': 227}