<commit_before>import React from 'react';
import { connect } from 'react-redux';

const quillLogoSrc = `${process.env.QUILL_CDN_URL}/images/logos/quill-logo-white.svg`

const handleLogoClick = () => {
  if (window.confirm('Are you sure you want to leave your lesson?')) {
    window.location = process.env.EMPIRICAL_BASE_URL;
  }
}

const Navbar = ({ classroomSessions, classroomLesson, customize, }) => {
  const { data } = classroomSessions;
  const lessonData = classroomLesson.data;
  const editionData = customize.editionQuestions;
  let slideName
  if (editionData && editionData.questions && data) {
    if (data.current_slide > 0) {
      slideName = [<span key="slide-number">Slide {parseInt(data.current_slide)}</span>, `: ${editionData.questions[data.current_slide].data.teach.title}`]
    } else {
      slideName = "Lobby"
    }
  } else {
    slideName = ''
  }
  return (
    <header className='nav student-nav'>
      <nav className="student-lessons">
        <img
          alt="Quill.org logo"
          className="quill-logo"
          onClick={handleLogoClick}
          src={quillLogoSrc}
        />
        <div className="slide-name" key="slide-name">{slideName}</div>
        <div className="lesson-name">{lessonData.title}</div>
      </nav><commit_msg>Dan's suggestions for navbar PR (#5788)<commit_after>import React from 'react';
import { connect } from 'react-redux';

const quillLogoSrc = `${process.env.QUILL_CDN_URL}/images/logos/quill-logo-white.svg`

const handleLogoClick = () => {
  if (window.confirm('Are you sure you want to leave your lesson?')) {
    window.location = process.env.EMPIRICAL_BASE_URL;
  }
}

const getSlideName = (editionData, data) => {
  if (!(editionData && editionData.questions && data)) { return '' }

  if (data.current_slide > 0) {
    return [<span key="slide-number">Slide {parseInt(data.current_slide)}</span>, `: ${editionData.questions[data.current_slide].data.teach.title}`]
  }

  return "Lobby"
}

const Navbar = ({ classroomSessions, classroomLesson, customize, }) => {
  const { data } = classroomSessions;
  const lessonData = classroomLesson.data;
  const editionData = customize.editionQuestions;

  return (
    <header className='nav student-nav'>
      <nav className="student-lessons">
        <img
          alt="Quill.org logo"
          className="quill-logo"
          onClick={handleLogoClick}
          src={quillLogoSrc}
        />
        <div className="slide-name" key="slide-name">{getSlideName(editionData, data)}</div>
        <div className="lesson-name">{lessonData.title}</div>
      </nav>
{'fraction_non_alphanumeric': 0.1472179289026275, 'fraction_numerical': 0.00231839258114374, 'mean_word_length': 3.5262237762237763, 'pattern_counts': {'":': 0, '<': 23, '<?xml version=': 0, '>': 30, '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': '1891080', 'n_tokens_mistral': 842, 'n_tokens_neox': 829, 'n_words': 157}