<commit_before>import { Meteor } from 'meteor/meteor';
import React, { PropTypes } from 'react';
import { createContainer } from 'meteor/react-meteor-data';
import { Container, Segment, Button } from 'semantic-ui-react';

import VolunteerTimerUI from './imports/volunteer-timer-ui';

class VolunteerTimerInner extends React.Component {
  constructor(props) {
    super(props);
  }

  render() {
    const { ready, team } = this.props;
    return (
      <Container>
        <PuzzlePageTitle title='Volunteer Timer'/>
        <Segment basic>
          { ready ? <VolunteerTimerUI team={ team }/> : <Loading/> }

          <Button basic size='large' fluid color='blue' content='Close This Page' onClick={(e) => window.close() }/>
        </Segment>
      </Container>
    );
  }
}

VolunteerTimerInner.propTypes = {
  ready: PropTypes.bool.isRequired,
  team: PropTypes.object,
};

// In this container "params" is coming from the props added via react-router.
VolunteerTimer = createContainer(({ params }) => {
  const { teamId, puzzleId } = params;
  const handle = Meteor.subscribe('volunteer.team', teamId);
  const ready = handle.ready();
  const team = Teams.findOne(teamId);
  return {
    ready,
    team,
  };
}, VolunteerTimerInner);
<commit_msg>Show error message if teamId is not found<commit_after>import { Meteor } from 'meteor/meteor';
import React, { PropTypes } from 'react';
import { createContainer } from 'meteor/react-meteor-data';
import { Container, Segment, Message, Button } from 'semantic-ui-react';

import VolunteerTimerUI from './imports/volunteer-timer-ui';

class VolunteerTimerInner extends React.Component {
  constructor(props) {
    super(props);
  }

  render() {
    const { ready, team } = this.props;
    return (
      <Container>
        <PuzzlePageTitle title='Volunteer Timer'/>
          { this._timerUI() }
          <Button basic size='large' fluid color='blue' content='Close This Page' onClick={(e) => window.close() }/>
      </Container>
    );
  }

  _timerUI() {
    const { ready, team, params } = this.props;
    if (!ready) {
      return <Loading />
    } else if (!team) {
      return <Message
        negative
        header='Oops!'
        content={ `No team with id ${prams.teamId}` }
      />;
    } else {
      return <VolunteerTimerUI team={ team }/>;
    }
  }
}

VolunteerTimerInner.propTypes = {
  ready: PropTypes.bool.isRequired,
  team: PropTypes.object,
};

// In this container "params" is coming from the props added via react-router.
VolunteerTimer = createContainer(({ params }) => {
  const { teamId, puzzleId } = params;
  const handle = Meteor.subscribe('volunteer.team', teamId);
  const ready = handle.ready();
  const team = Teams.findOne(teamId);
  return {
    ready,
    team,
  };
}, VolunteerTimerInner);

{'fraction_non_alphanumeric': 0.13835125448028673, 'fraction_numerical': 0.0, 'mean_word_length': 3.2096530920060333, 'pattern_counts': {'":': 0, '<': 18, '<?xml version=': 0, '>': 22, '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': '246034', 'n_tokens_mistral': 882, 'n_tokens_neox': 860, 'n_words': 221}