import React from 'react'
import PropTypes from 'prop-types'

export const LabelContent = React.forwardRef(({ children, forId }, ref) => (
  <label ref={ref} htmlFor={forId} style={staticStyles.inheritCursor}>
    {children}
  </label>
))
LabelContent.displayName = 'LabelContent'

LabelContent.propTypes = {
  children: PropTypes.string,
  forId: PropTypes.string
}

// Note that <label> is not React Native, so we can't use `StyleSheet.create` here
const staticStyles = {
  inheritCursor: { cursor: 'inherit' }
}
