<commit_before>import PropTypes from 'prop-types';
import React from 'react';
import { Button, Popover, OverlayTrigger } from 'react-bootstrap';
import { observer } from 'mobx-react';
import { action } from 'mobx';
import { Icon } from 'shared';
import Name from '../../components/name';
import Student from '../../models/course/student';

export default
@observer
class DropStudentLink extends React.Component {

  static propTypes = {
    student: PropTypes.instanceOf(Student).isRequired,
  }

  @action.bound performDeletion() {
    this.props.student.drop();
  }

  popOverTitle() {
    if (this.props.student.api.isPending) {
      return (
        <span><Icon type="spinner" spin />Dropping…</span>
      );
    }
    return (
      <span>
        Drop <Name {...this.props.student} />
      </span>
    );
  }

  confirmPopOver() {
    return (
      <Popover id="drop-student">
        <Popover.Title>
          this.popOverTitle()}
        </Popover.Title>
        <Popover.Content>
          <Button className="-drop-student" onClick={this.performDeletion} variant="danger">
            <Icon type="ban" /> Drop
          </Button>
        </Popover.Content>
      </Popover>
    );
  }

  render() {<commit_msg>fix missing { which caused code to appear in title<commit_after>import PropTypes from 'prop-types';
import React from 'react';
import { Button, Popover, OverlayTrigger } from 'react-bootstrap';
import { observer } from 'mobx-react';
import { action } from 'mobx';
import { Icon } from 'shared';
import Name from '../../components/name';
import Student from '../../models/course/student';

export default
@observer
class DropStudentLink extends React.Component {

  static propTypes = {
    student: PropTypes.instanceOf(Student).isRequired,
  }

  @action.bound performDeletion() {
    this.props.student.drop();
  }

  popOverTitle() {
    if (this.props.student.api.isPending) {
      return (
        <span><Icon type="spinner" spin />Dropping…</span>
      );
    }
    return (
      <span>
        Drop <Name {...this.props.student} />
      </span>
    );
  }

  confirmPopOver() {
    return (
      <Popover id="drop-student">
        <Popover.Title>
          {this.popOverTitle()}
        </Popover.Title>
        <Popover.Content>
          <Button className="-drop-student" onClick={this.performDeletion} variant="danger">
            <Icon type="ban" /> Drop
          </Button>
        </Popover.Content>
      </Popover>
    );
  }

  render() {
{'fraction_non_alphanumeric': 0.14895330112721417, 'fraction_numerical': 0.0, 'mean_word_length': 2.5704022988505746, 'pattern_counts': {'":': 0, '<': 33, '<?xml version=': 0, '>': 33, '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': '5929387', 'n_tokens_mistral': 749, 'n_tokens_neox': 742, 'n_words': 170}