<commit_before>kd          = require 'kd'
React       = require 'app/react'
ReactToggle = require 'react-toggle'

require './styl/toggle.styl'
require './styl/popover.styl'

module.exports = class Toggle extends React.Component

  @defualtProps =
    size            : 'small'
    defaultChecked  : no
    callback        : kd.noop


  onChange: (event) ->

    @props.callback event.target.checked


  render: ->

    className = "#{kd.utils.curry('ReactToggle', @props.className)} #{@props.size}"

    props = _.omit @props, ['callback']

    props.checked or= no
    <div className={className}>
      <ReactToggle {...props} onChange={@bound 'onChange'} />
    </div>

<commit_msg>app/toggle: fix typo and remove unnecessary props while rendering toggle<commit_after>kd          = require 'kd'
React       = require 'app/react'
ReactToggle = require('react-toggle').default

require './styl/toggle.styl'
require './styl/popover.styl'

module.exports = class Toggle extends React.Component

  @defaultProps =
    size            : 'small'
    callback        : kd.noop


  onChange: (event) ->

    @props.callback event.target.checked


  render: ->

    className = "#{kd.utils.curry('ReactToggle', @props.className)} #{@props.size}"

    props = _.omit @props, ['callback', 'className', 'size']

    props.checked or= no
    <div className={className}>
      <ReactToggle {...props} onChange={@bound 'onChange'} />
    </div>


{'fraction_non_alphanumeric': 0.14804469273743018, 'fraction_numerical': 0.0, 'mean_word_length': 2.841823056300268, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 13, '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': '5517934', 'n_tokens_mistral': 456, 'n_tokens_neox': 444, 'n_words': 104}