import AttrListEdit from './components/AttrListEdit.jsx';
import JsonDisplay from './components/JsonDisplay.jsx';
function ExtendedAttributesEdit({attributes, setAttributes, ...props}) {
console.log("rendering with attributes: ", attributes);
if (!attributes) {
return ;
}
function attributeListSetter(attributeName) {
return (newValue) => setAttributes((a) => {
if (a === null) return a;
let newList = {...a}
newList[attributeName] = newValue;
return newList;
});
}
const newAttributes = {...attributes,
parent: undefined,
location: undefined,
contents: undefined,
verbs: undefined,
prepositions: undefined
}
let parentSnip;
if (!attributes.hasOwnProperty("parent") || attributes.parent === null || attributes.parent === undefined) {
parentSnip =
This object does not have a parent.
;
} else {
parentSnip = ;
}
let locationSnip;
if (!attributes.hasOwnProperty("location") || attributes.location === null || attributes.location === undefined) {
locationSnip =
This object does not have a location.
;
} else {
locationSnip = ;
}
return <>
{parentSnip}
{locationSnip}
>
}
export default ExtendedAttributesEdit;