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 (
{`${pair.key}: ${pair.value}`}
))}{`${pair.key}: ${pair.value}`}
))}