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" && key != "isReferenceValue") let othervalues = otherkeys.map(key => element[key]) let otherpairs = otherkeys.map((key,i) => ({key: capitalizeFirstLetter(key), value: othervalues[i]})) if(element.url){ return(
{/**/}

{`${element.name}`}

{/*
*/} {otherpairs.map(pair =>

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

)}

More info

) }else{ return(

{`${element.name}`}

{otherpairs.map(pair =>

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

)}
) } }