mirror of
https://github.com/strapi/strapi.git
synced 2025-08-29 19:22:24 +00:00
27 lines
581 B
JavaScript
Executable File
27 lines
581 B
JavaScript
Executable File
/**
|
|
*
|
|
* ToggleOption
|
|
*
|
|
*/
|
|
|
|
import React from 'react';
|
|
import PropTypes from 'prop-types';
|
|
import { injectIntl, intlShape } from 'react-intl';
|
|
|
|
const ToggleOption = ({ value, message, intl }) => (
|
|
<option value={value}>
|
|
{typeof message === 'string' ? message : intl.formatMessage(message).toUpperCase()}
|
|
</option>
|
|
);
|
|
|
|
ToggleOption.propTypes = {
|
|
intl: intlShape.isRequired,
|
|
message: PropTypes.oneOfType([
|
|
PropTypes.object.isRequired,
|
|
PropTypes.string.isRequired,
|
|
]).isRequired,
|
|
value: PropTypes.string.isRequired,
|
|
};
|
|
|
|
export default injectIntl(ToggleOption);
|