<commit_before>###* @jsx React.DOM ###
  
React = require 'react'
_ = require 'underscore'

App = require '../App.coffee'
Tabletop = require '../libs/tabletop.js'

List = require './List.coffee'
Detail = require './Detail.coffee'

module.exports = React.createClass
  componentDidMount: ->    
    Tabletop.init
      key: '<KEY>'
      simpleSheet: true
      callback: @handleTabletop
      
  handleTabletop: (data, tabletop)->
    if not data then return
      
    # normalize data
    map_columns =
      andyouremailaddress: "email"
      anyotherremarks: "remarks"
      approvedforthisyear: "year"
      howdidyoufindoutabouttheproject: "referer"
      inwhatcitywouldyouliketoorganize8i: "city"
      inwhatcountryisthat: "country"
      whatsyourname: "name"

    _.map data, (row)->            
      for own key, val of row
        if key of map_columns
          row[map_columns[key]] = val
          delete row[key]
          
    @setState(items: data)

  render: ->  
    if @state?.items
      `<div class="row sqs-row">
          <div class="col sqs-col-4 span-4"><List items={this.state.items} /></div>
          <div class="col sqs-col-8 span-8" id="doc-detail"><Detail /></div>
        </div>`      
    else 
      `<div>Loading cities...</div>`<commit_msg>truncate<commit_after>###* @jsx React.DOM ###
  
React = require 'react'
_ = require 'underscore'

App = require '../App.coffee'
Tabletop = require '../libs/tabletop.js'

List = require './List.coffee'
Detail = require './Detail.coffee'

module.exports = React.createClass
  componentDidMount: ->    
    Tabletop.init
      key: '<KEY>'
      simpleSheet: true
      callback: @handleTabletop
      
  handleTabletop: (data, tabletop)->
    if not data then return
      
    map_columns =
      andyouremailaddress: "email"
      anyotherremarks: "remarks"
      approvedforthisyear: "year"
      howdidyoufindoutabouttheproject: "referer"
      inwhatcitywouldyouliketoorganize8i: "city"
      inwhatcountryisthat: "country"
      whatsyourname: "name"

    _.map data, (row)->            
      for own key, val of row
        if key of map_columns
          row[map_columns[key]] = val
          delete row[key]
          
    @setState(items: data)

  render: ->  
    if @state?.items
      `<div class="row sqs-row">
          <div class="col sqs-col-4 span-4"><List items={this.state.items} /></div>
          <div class="col sqs-col-8 span-8" id="doc-detail"><Detail /></div>
        </div>`      
    else 
      `<div>Loading cities...</div>`
{'fraction_non_alphanumeric': 0.1345698500394633, 'fraction_numerical': 0.003946329913180742, 'mean_word_length': 2.335526315789474, 'pattern_counts': {'":': 0, '<': 25, '<?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': '3596592', 'n_tokens_mistral': 827, 'n_tokens_neox': 812, 'n_words': 189}