import React from 'react'
import cx from 'classnames'
import { isEmpty, propOr } from 'ramda'

function MTSelectSelectionSingle (props) {
  const {
    selection,
    hidden,
    className,
    ...otherProps
  } = props
  const label = propOr('', 'label', selection)
  const selectionStyle = { display: hidden ? 'none' : 'block' }

  return (
    <span
      { ...otherProps }
      className={ cx('mt-select-selection-single', className) }
      style={ selectionStyle }
    >
      <span className="mt-select-selection-single__label">
        <strong>{ isEmpty(label) ? '\xa0' : label }</strong>
      </span>
    </span>
  )
}

export default MTSelectSelectionSingle
