<commit_before># @cjsx React.DOM

# creating a button component that could set defaults depending on props.
# currently modeled on action button.

React = require 'react'

module.export = React.createClass
  displayName: 'ButtonLink'

  propTypes: 
    name: React.PropTypes.string
    type: React.PropTypes.string
    url: React.PropTypes.string
    className

  # getDefaultProps: ->


  handleClick: (event) ->
    event.preventDefault()
      $.ajax
        url: this.props.url
        dataType: 'json'
        type: this.props.type
        success: (data) ->
          #further thought needed
          #if a delete button it will depend on parent component?
          console.log "Success, here is data: #{data}" 
        error: (jqXHR, textStatus, errorThrown) ->
          console.log "Error in button action:", xhr, textStatus, errorThrown
          

  render: ->
    <a className={this.props.name} type={this.props.type} url={this.props.url} onClick={@handleClick} > </a>



     

<commit_msg>removed className for now<commit_after># @cjsx React.DOM

# creating a button component that could set defaults depending on props.
# currently modeled on action button.

React = require 'react'

module.export = React.createClass
  displayName: 'ButtonLink'

  propTypes: 
    name: React.PropTypes.string
    type: React.PropTypes.string
    url: React.PropTypes.string

  handleClick: (event) ->
    event.preventDefault()
      $.ajax
        url: this.props.url
        dataType: 'json'
        type: this.props.type
        success: (data) ->
          #further thought needed
          #if a delete button it will depend on parent component?
          console.log "Success, here is data: #{data}" 
        error: (jqXHR, textStatus, errorThrown) ->
          console.log "Error in button action:", xhr, textStatus, errorThrown


  render: ->
    <a type={this.props.type} url={this.props.url} onClick={@handleClick} > </a>



     


{'fraction_non_alphanumeric': 0.10751028806584362, 'fraction_numerical': 0.0, 'mean_word_length': 2.642322097378277, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 16, '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': '4886602', 'n_tokens_mistral': 580, 'n_tokens_neox': 558, 'n_words': 170}