Why Gemfury? Push, build, and install  RubyGems npm packages Python packages Maven artifacts PHP packages Go Modules Debian packages RPM packages NuGet packages

Repository URL to install this package:

Details    
Size: Mime:
import React from 'react'
import { checkbox, StyledLabel } from './_styled'
import { ToggleLabelProps } from './typings'

export default class Label extends React.PureComponent<ToggleLabelProps> {
  render() {
    // text is standard
    const {
      children,
      text,
      className,
      identifier,
      onClick,
      dataQa,
    } = this.props

    const attributes = {
      className,
      onClick,
      // meta
      'htmlFor': identifier,
      'key': identifier,
      'tabIndex': '0',
      'data-qa': dataQa,
    }

    return <StyledLabel {...attributes} children={children || text} />
    // return React.createElement('label', attributes, children || text)
  }
}