2016-10-13 19:31:29 +02:00
|
|
|
/**
|
|
|
|
*
|
|
|
|
* ToggleOption
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
|
|
|
import React from 'react';
|
|
|
|
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 = {
|
|
|
|
value: React.PropTypes.string.isRequired,
|
2016-10-13 20:53:33 +02:00
|
|
|
message: React.PropTypes.oneOfType([
|
|
|
|
React.PropTypes.object,
|
|
|
|
React.PropTypes.string,
|
|
|
|
]),
|
2016-10-13 19:31:29 +02:00
|
|
|
intl: intlShape.isRequired,
|
|
|
|
};
|
|
|
|
|
|
|
|
export default injectIntl(ToggleOption);
|