I know that "glace" in French is not capitalized, I wanted to go with the same format from the buttons.
I wanted to point out that the implementation is pretty fragile if the business decides one day that more languages need to be supported
something like the following would be safe ass the text will most likely be used as a i18n key depending on the library that is used
handleClick(itemName){if(this.props[`order${itemName}`]===undefined){return()=>{console.log("I'm sorry. We don't have that menu item.")};}returnthis.props[`order${itemName}`];}<buttononClick={this.handleClick(this.props.text)}>{this.props.text}// this.props.text = "Pizza", "Cheeseburger" or "Ice Cream"</button>
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
I know that "glace" in French is not capitalized, I wanted to go with the same format from the buttons.
I wanted to point out that the implementation is pretty fragile if the business decides one day that more languages need to be supported
something like the following would be safe ass the text will most likely be used as a i18n key depending on the library that is used