import React from "react"; let capitalizeFirstLetter = (string) => string.charAt(0).toUpperCase() + string.slice(1) export function DisplayElement({element}){ let otherkeys = Object.keys(element).filter(key => key!="name" && key!="url" && key != "id") let othervalues = otherkeys.map(key => element[key]) let otherpairs = otherkeys.map((key,i) => ({key: capitalizeFirstLetter(key), value: othervalues[i]})) return(

{`${element.name}`}

{otherpairs.map(pair =>

{`${pair.key}: ${pair.value}`}

)}
) }