{activePanel === 'tool' &&
onElementsDeleted([selectedElement.id]) : undefined} onUpdateProperty={(key, value) => {
if (!selectedElement || !onUpdateElement) return;
const updated = { ...selectedElement };
if (key === 'x' || key === 'y' || key === 'width' || key === 'height') {
const numVal = typeof value === 'string' ? parseFloat(value.replace(/[^0-9.\-]/g, '')) || 0 : value as number;
if (key === 'x') updated.x = numVal;
else if (key === 'y') updated.y = numVal;
else if (key === 'width') updated.width = numVal;
else if (key === 'height') updated.height = numVal;
} else if (key === 'layerId') {
updated.layerId = value as string;
} else if (key === 'rotation') {
const rotVal = typeof value === 'string' ? parseFloat(value.replace(/[^0-9.\-]/g, '')) || 0 : value as number;
updated.properties = { ...updated.properties, rotation: rotVal };
} else {
updated.properties = { ...updated.properties, [key]: value };
}
onUpdateElement(updated);
}} />}
{activePanel === 'layer' && {})} onAddLayer={onAddLayer ?? (() => {})} onToggleLayer={onToggleLayer ?? (() => {})} onDeleteLayer={onDeleteLayer} onRenameLayer={onRenameLayer} onDuplicateLayer={onDuplicateLayer} onToggleLock={onToggleLock} onReorder={onReorder} onAddSubLayer={onAddSubLayer} />}
{activePanel === 'library' && {})} onSearch={onBlockSearch ?? (() => {})} onDragBlock={onDragBlock ?? (() => {})} onRenameBlock={onRenameBlock} onDuplicateBlock={onDuplicateBlock} onDeleteBlock={onDeleteBlock} onSvgImport={onSvgImport} onSaveGroupAsBlock={onSaveGroupAsBlock} />}
{activePanel === 'ki' && {})} onSuggestionClick={onKISuggestionClick ?? (() => {})} loading={kiLoading} />}