<commit_before>import React from "react";
import {Link} from "react-router-dom";

const Nav = () =>
    <nav>
        <ul>
            <li><Link to="/">Home</Link></li>
            <li><Link to="/login">Login</Link></li>
        </ul>
    </nav>;

export default Nav;<commit_msg>show manage link if login user is admin role<commit_after>import React from "react";
import PropTypes from "prop-types";
import {connect} from "react-redux";
import {Link} from "react-router-dom";

const Nav = ({role}) =>
    <nav>
        <ul>
            <li><Link to="/">Home</Link></li>
            <li><Link to="/login">Login</Link></li>
            {role === "admin" ? <li><Link to="/user-manage">Manage Users</Link></li> : ""}
        </ul>
    </nav>;

Nav.propTypes = {
    role: PropTypes.string
};

export default connect(state => ({
    role: state.currentUser.role
}))(Nav);
{'fraction_non_alphanumeric': 0.20092378752886836, 'fraction_numerical': 0.0, 'mean_word_length': 2.7051282051282053, 'pattern_counts': {'":': 0, '<': 31, '<?xml version=': 0, '>': 34, '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': '1675759', 'n_tokens_mistral': 280, 'n_tokens_neox': 279, 'n_words': 69}