<commit_before>import { BaseNew, FormContainer, FormSection } from 'features/shared/components'
import { TextField, HiddenField } from 'components/Common'
import React from 'react'
import { reduxForm } from 'redux-form'
import { humanize } from 'utility/string'

const clientType = 'client_access_token'
const networkType = 'network_access_token'

const Form = class Form extends React.Component {
  constructor(props) {
    super(props)

    this.submitWithErrors = this.submitWithErrors.bind(this)
  }

  submitWithErrors(data) {
    return new Promise((resolve, reject) => {
      this.props.submitForm(data)
        .catch((err) => reject({_error: err.message}))
    })
  }

  render() {
    const {
      fields: { id, type },
      error,
      handleSubmit,
      submitting
    } = this.props

    const label = humanize(this.props.type)

    return(<FormContainer
      error={error}
      label={`New ${label}`}
      onSubmit={handleSubmit(this.submitWithErrors)}
      submitting={submitting} >

      <FormSection title='Token Information'>
        <TextField title='Token ID' placeholder='Token ID' fieldProps={id} autoFocus={true} />
        <HiddenField fieldProps={type} />
      </FormSection>
    </FormContainer>)
  }<commit_msg>dashboard: show instructions for access token valid chars<commit_after>import { BaseNew, FormContainer, FormSection } from 'features/shared/components'
import { TextField, HiddenField } from 'components/Common'
import React from 'react'
import { reduxForm } from 'redux-form'
import { humanize } from 'utility/string'

const clientType = 'client_access_token'
const networkType = 'network_access_token'

const Form = class Form extends React.Component {
  constructor(props) {
    super(props)

    this.submitWithErrors = this.submitWithErrors.bind(this)
  }

  submitWithErrors(data) {
    return new Promise((resolve, reject) => {
      this.props.submitForm(data)
        .catch((err) => reject({_error: err.message}))
    })
  }

  render() {
    const {
      fields: { id, type },
      error,
      handleSubmit,
      submitting
    } = this.props

    const label = humanize(this.props.type)

    return(<FormContainer
      error={error}
      label={`New ${label}`}
      onSubmit={handleSubmit(this.submitWithErrors)}
      submitting={submitting} >

      <FormSection title='Token Information'>
        <TextField
          title='Token ID'
          placeholder='Token ID'
          fieldProps={id}
          autoFocus={true}
          hint='Valid characters include letters, numbers, underscores, and hyphens.'
        />
        <HiddenField fieldProps={type} />
      </FormSection>
    </FormContainer>)
  }
{'fraction_non_alphanumeric': 0.11958146487294469, 'fraction_numerical': 0.0, 'mean_word_length': 3.2424722662440573, 'pattern_counts': {'":': 0, '<': 15, '<?xml version=': 0, '>': 19, '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': '975795', 'n_tokens_mistral': 777, 'n_tokens_neox': 758, 'n_words': 175}