handleRootDragOver(e, index, key)}
onDragLeave={handleDragLeave}
onDrop={(e) => handleDrop(e, 'root', index)}
className={getRootWrapperClass(index, key)}
>
= groupItems.length
}
dragHandle={
isLayoutEditing
? renderDragHandle({
kind: 'flexGroup',
key,
sourceParent: 'root',
sourceIndex: index
})
: null
}
onRemove={
isLayoutEditing ? () => removeGroup(key) : undefined
}
onDragOver={(e) => handleGroupContainerDragOver(e, key)}
onDrop={(e) => handleDrop(e, key, groupItems.length)}
onDragLeave={handleDragLeave}
proportions={renderProportions}
onProportionsChange={
isLayoutEditing
? (next) => updateFlexColumnProportions(key, next)
: undefined
}
>
{itemsToRender.map((childKey, childIndex) => {
const section = sectionsByKey[childKey]
if (!section) return null
return (
handleGroupItemDragOver(e, key, childIndex)
}
onDragLeave={handleDragLeave}
onDrop={(e) => handleDrop(e, key, childIndex)}
className={getGroupItemClass(
key,
childIndex,
childKey
)}
>
{renderCollapse(
section,
isLayoutEditing
? renderDragHandle({
kind: 'section',
key: childKey,
sourceParent: key,
sourceIndex: childIndex
})
: null
)}
)
})}
)
}
const section = sectionsByKey[key]
if (!section) return null
if (!isItemVisible(section.key)) {
return null
}
return (
handleRootDragOver(e, index, key)}
onDragLeave={handleDragLeave}
onDrop={(e) => handleDrop(e, 'root', index)}
className={getRootWrapperClass(index, key)}
>
{renderCollapse(
section,
isLayoutEditing
? renderDragHandle({
kind: 'section',
key,
sourceParent: 'root',
sourceIndex: index
})
: null
)}
)
})}