I have an object which looks like this:
const jewels = {
infantry: {
'3OayPUASk1JJFJwpKW7u': {
id: '3OayPUASk1JJFJwpKW7u',
name: 'Infantry ATK Jewel ',
url: 'https://lordsmobilepro.com/wp-content/uploads/2021/01/Infantry-ATK-Jewel.jpg',
effects: ['Inf ATK 20%'],
},
'5N3y7DfjZwFTPxoyg3La': {
id: '5N3y7DfjZwFTPxoyg3La',
name: 'Terror Jewel',
url: 'https://lordsmobilepro.com/wp-content/uploads/2021/01/Terror-Jewel.jpg',
effects: ['Inf ATK 10%', 'Inf DEF 10%'],
},
'7mOdjVqp9co87Ymkvk9F': {
id: '7mOdjVqp9co87Ymkvk9F',
name: 'Trojan Jewel',
url: 'https://lordsmobilepro.com/wp-content/uploads/2021/01/Trojan-Jewel.jpg',
effects: ['Inf HP 15%', 'Travel Speed 5%'],
},
} etc ....
I would like to map the object so it would look like this for every item:
<h1>{infantry.name}</h1>
<img src='`${infantry.url}`'/>
<h2>{infantry.effects}<h2/>
I did something like this:
const output = Object.values(jewels.infantry).map(({ name }) => (name));
My logic is obviously flawed here, I couldn't figure out how can I map multiple properties, I just mapped the name.
I would appreciate some help!