Repository URL to install this package:
|
Version:
0.14.1 ▾
|
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)
}
}