27 lines
581 B
JavaScript
Raw Normal View History

2016-10-13 19:31:29 +02:00
/**
*
* ToggleOption
*
*/
import React from 'react';
import PropTypes from 'prop-types';
2016-10-13 19:31:29 +02:00
import { injectIntl, intlShape } from 'react-intl';
const ToggleOption = ({ value, message, intl }) => (
<option value={value}>
2016-10-13 20:53:33 +02:00
{typeof message === 'string' ? message : intl.formatMessage(message).toUpperCase()}
2016-10-13 19:31:29 +02:00
</option>
);
ToggleOption.propTypes = {
intl: intlShape.isRequired,
message: PropTypes.oneOfType([
PropTypes.object.isRequired,
PropTypes.string.isRequired,
2017-08-18 17:02:33 +02:00
]).isRequired,
value: PropTypes.string.isRequired,
2016-10-13 19:31:29 +02:00
};
export default injectIntl(ToggleOption);