I have an array of JSON data I am using. Each array item is a blog category, but in the JSON it is presented as the category id#. With the code below, I'm not sure how to set a new array that essentially converts the category id# to the category name. I would have to set what each id# is supposed to be named.
const ButtonCategories = (productCategories, setCategory) => {
return (
productCategories.map(category => (
<button
key={category}
className={`filter-button btn-${category}`}
onClick={() => setCategory(category)}
>
{category}
</button>
)));
}