<commit_before>import React from 'react'
import { AUTH_PAGE_ROUTE } from '../routes.js';
import Menu from './Menu.jsx'

const MySessions = (props) => {
  console.log('MySessions props: ', props);
  // var handleClick = function() {
  //   console.log('clicked!');
  // }

  // function handleClick(e) {
  //   console.log(e.target.getAttribute('data-key'), props);
  //   // props.thunkUpdateSession(e.target.getAttribute('data-key'));
  // }

 // href={MAIN_PAGE_ROUTE} --- goes in a tag on line 28

  return (
      <div>
        <h3>Your Brainstorm sessions:</h3>
        <ul>
          {props.user.created_sessions.map((session) => {
            return <div
              key={session._id}
              className="profile-created-session session-title"
              onClick={(e) => {props.thunkUpdateSession(e.target.getAttribute('data-key'))}}
              >
              <a href={AUTH_PAGE_ROUTE}>
                <li data-key={session._id}>
                  {session.title}
                </li>
              </a>
            </div>
          })}
        </ul>
        <h3>Sessions you contribute to:</h3>
        <ul>
          {props.user.accessible_sessions.map((session) => {
            if (props.user.created_sessions.includes(session)) {
              return <li className="profile-accessed-session" onClick={() => {console.log('accessible clicked!')}}>{session.title}</li>
            }
          })}
        </ul>
      </div>
    )
}

export default MySessions<commit_msg>Extrapolate profile session link functionality to accessed sessions list<commit_after>import React from 'react'
import { AUTH_PAGE_ROUTE } from '../routes.js';
import Menu from './Menu.jsx'

const MySessions = (props) => {
  console.log('MySessions props: ', props);
  // var handleClick = function() {
  //   console.log('clicked!');
  // }

  // function handleClick(e) {
  //   console.log(e.target.getAttribute('data-key'), props);
  //   // props.thunkUpdateSession(e.target.getAttribute('data-key'));
  // }

 // href={MAIN_PAGE_ROUTE} --- goes in a tag on line 28

  return (
      <div>
        <h3>Your Brainstorm sessions:</h3>
        <ul>
          {props.user.created_sessions.map((session) => {
            return <div
              key={session._id}
              className="profile-created-session session-title"
              onClick={(e) => {props.thunkUpdateSession(e.target.getAttribute('data-key'))}}
              >
              <a href={AUTH_PAGE_ROUTE}>
                <li data-key={session._id}>
                  {session.title}
                </li>
              </a>
            </div>
          })}
        </ul>
        <h3>Sessions you contribute to:</h3>
        <ul>
          {props.user.accessible_sessions.map((session) => {
            if (session.creator_id !== props.user.userId) {
              return <div
                key={session._id}
                className="profile-accessed-session session-title"
                onClick={(e) => {props.thunkUpdateSession(e.target.getAttribute('data-key'))}}
                >
                <a href={AUTH_PAGE_ROUTE}>
                  <li data-key={session._id}>
                    {session.title}
                  </li>
                </a>
              </div>            }
          })}
        </ul>
      </div>
    )
}

export default MySessions
{'fraction_non_alphanumeric': 0.15458358298382266, 'fraction_numerical': 0.0035949670461354103, 'mean_word_length': 1.7391304347826086, 'pattern_counts': {'":': 0, '<': 43, '<?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': '7642166', 'n_tokens_mistral': 999, 'n_tokens_neox': 984, 'n_words': 171}