<commit_before>import React, { Component } from 'react';
import Carousel from 'nuka-carousel';
import VideoThumb from './VideoThumb';
import SmallDropdownButton from './SmallDropdownButton';

class PlaylistCarousel extends Component {
  renderThumbs () {
    const { playlist } = this.props;
    let index = 0;
    return playlist.map(thumb => {
      return (
        <VideoThumb key={index++} video={{
          videocode: thumb.videocode,
          title: thumb.video_title,
          uploadername: thumb.video_uploader
        }} />
      )
    })
  }

  onEditTitle() {

  }

  onDeleteClick() {

  }

  render () {
    const { title, uploader, editable } = this.props;
    const menuProps = [
      {
        label: 'Edit Title',
        onClick: this.onEditTitle.bind(this)
      },
      {
        label: 'Change Videos',
        onClick: this.onEditTitle.bind(this)
      },
      {
        label: 'Reorder Videos',
        onClick: this.onEditTitle.bind(this)
      },
      {
        separator: true
      },
      {
        label: 'Remove Playlist',
        onClick: this.onDeleteClick.bind(this)
      }
    ]
    return (
      <div className="container-fluid">
        <div className="row">
          <h4
            style={{
              marginLeft:"1rem"
            }}
            className="pull-left"
          >
            {title} <small>by {uploader}</small>
          </h4>
          {
            editable && <SmallDropdownButton
              menuProps={menuProps}
              rightMargin="1em"
            /><commit_msg>Adding playlist title edit feature<commit_after>import React, { Component } from 'react';
import Carousel from 'nuka-carousel';
import VideoThumb from './VideoThumb';
import SmallDropdownButton from './SmallDropdownButton';

class PlaylistCarousel extends Component {
  state = {
    onEdit: false
  }

  renderThumbs () {
    const { playlist } = this.props;
    let index = 0;
    return playlist.map(thumb => {
      return (
        <VideoThumb key={index++} video={{
          videocode: thumb.videocode,
          title: thumb.video_title,
          uploadername: thumb.video_uploader
        }} />
      )
    })
  }

  onEditTitle() {
    this.setState({onEdit: true})
  }

  onDeleteClick() {

  }

  render () {
    const { onEdit } = this.state;
    const { title, uploader, editable } = this.props;
    const menuProps = [
      {
        label: 'Edit Title',
        onClick: this.onEditTitle.bind(this)
      },
      {
        label: 'Change Videos',
        onClick: this.onEditTitle.bind(this)
      },
      {
        label: 'Reorder Videos',
        onClick: this.onEditTitle.bind(this)
      },
      {
        separator: true
      },
      {
        label: 'Remove Playlist',
        onClick: this.onDeleteClick.bind(this)
      }
    ]
    return (
      <div className="container-fluid">
        <div className="row container-fluid">
          {
            onEdit ?
            <div
              className="input-group col-sm-6 pull-left"
              style={{
                paddingBottom: '0.3em'
              }}
            >
              <form>
                <input
                  ref="editTitleInput"
                  type="text"
                  className="form-control"
                  placeholder="Enter Title..."
                />
              </form>
            </div>
            :
            <h4
              className="pull-left"
            >
              {title} <small>by {uploader}</small>
            </h4>
          }
          {
            editable && <SmallDropdownButton
              menuProps={menuProps}
              rightMargin="1em"
            />
{'fraction_non_alphanumeric': 0.11740670117134296, 'fraction_numerical': 0.003268864069735767, 'mean_word_length': 1.5324137931034483, 'pattern_counts': {'":': 0, '<': 24, '<?xml version=': 0, '>': 26, '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': '7134268', 'n_tokens_mistral': 1068, 'n_tokens_neox': 1051, 'n_words': 206}