{
setTemporarilyOpenedItems([])
resetAll()
}}
items={items}
selectedItems={selectedItems}
attributes={attributes}
setAttributes={setAttributes}
onItemClick={(itemLabel) => {
if (!selectedItems.includes(itemLabel)) {
setTemporarilyOpenedItems([
...temporarilyOpenedItems,
itemLabel,
])
return
}
const item = items
.reduce((acc, group) => [...acc, ...group.items], [])
.find((item) => item.label === itemLabel)
setTemporarilyOpenedItems(
temporarilyOpenedItems.filter(
(item) => item !== itemLabel
)
)
item.reset()
}}
/>
{items
.reduce((acc, group) => [...acc, ...group.items], [])
.filter((item) => selectedItems.includes(item.label))
.map((item) => {
return item.render()
})}
)
}
export default ToolsPanel