<commit_before>React = require 'react/addons'
cx = React.addons.classSet

Favorite = require 'zooniverse/models/favorite'
Recent = require 'zooniverse/models/recent'
User = require 'zooniverse/models/user'

ProfileItems = React.createClass
  displayName: 'ProfileItems'

  getInitialState: ->
    recents: null
    favorites: null

  componentWillMount: ->
    setTimeout ( =>
      if User.current
        Recent.fetch (recents) =>
          @setState recents: recents
        Favorite.fetch (favorites) =>
          @setState favorites: favorites
    ), 2000

  render: ->
    items = @state[@props.collection]?.map (item, i) =>
      <video key={i} poster={item.subjects[0]?.location.previews[0]} src={item.subjects[0]?.location.standard} width="33%" type="video/mp4" controls>
        Your browser does not support the video format. Please upgrade your browser.
      </video>

    <div className="item">
      {items}
    </div>

module.exports = ProfileItems<commit_msg>Added loading statement to profile<commit_after>React = require 'react/addons'
cx = React.addons.classSet

Favorite = require 'zooniverse/models/favorite'
Recent = require 'zooniverse/models/recent'
User = require 'zooniverse/models/user'

ProfileItems = React.createClass
  displayName: 'ProfileItems'

  getInitialState: ->
    recents: null
    favorites: null

  componentWillMount: ->
    setTimeout ( =>
      if User.current
        Recent.fetch (recents) =>
          @setState recents: recents
        Favorite.fetch (favorites) =>
          @setState favorites: favorites
    ), 2000

  render: ->
    items = @state[@props.collection]?.map (item, i) =>
      <video key={i} poster={item.subjects[0]?.location.previews[0]} src={item.subjects[0]?.location.standard} width="33%" type="video/mp4" controls>
        Your browser does not support the video format. Please upgrade your browser.
      </video>

    <div className="item">
      {<p>Loading...</p> if @state[@props.collection] is null}
      {items}
    </div>

module.exports = ProfileItems
{'fraction_non_alphanumeric': 0.12917485265225934, 'fraction_numerical': 0.009823182711198428, 'mean_word_length': 3.306553911205074, 'pattern_counts': {'":': 0, '<': 13, '<?xml version=': 0, '>': 27, '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': '5247213', 'n_tokens_mistral': 626, 'n_tokens_neox': 614, 'n_words': 146}