webpack/components/common/RailsData.js in foreman_acd-0.9.7 vs webpack/components/common/RailsData.js in foreman_acd-0.10.0

- old
+ new

@@ -1,27 +1,17 @@ import React from 'react'; import PropTypes from 'prop-types'; -const RailsData = ({ - view, - parameter, - value, -}) => { - const id = "foreman_acd_"+ view +"_"+ parameter; - const name = "foreman_acd_"+ view +"["+ parameter +"]"; +const RailsData = ({ view, parameter, value }) => { + const id = `foreman_acd_${view}_${parameter}`; + const name = `foreman_acd_${view}[${parameter}]`; - return ( - <input - id={id} - name={name} - value={value} - type="hidden" - /> - ); -} + return <input id={id} name={name} value={value} type="hidden" />; +}; RailsData.propTypes = { view: PropTypes.string.isRequired, parameter: PropTypes.string.isRequired, + value: PropTypes.string.isRequired, }; export default RailsData;