up
This commit is contained in:
@@ -132,6 +132,12 @@ const NoteFlow = () => {
|
||||
const handleTabClick = (option) => {
|
||||
setShowTabBar(false);
|
||||
|
||||
|
||||
if (selectedNodeId === option.id) {
|
||||
alert('Node này đã được thêm. Vui lòng chọn một node khác.');
|
||||
return;
|
||||
}
|
||||
|
||||
const newNode = {
|
||||
id: option.id,
|
||||
data: { label: option.html },
|
||||
@@ -250,6 +256,7 @@ const NoteFlow = () => {
|
||||
setShowPopup(false);
|
||||
}
|
||||
|
||||
|
||||
return (
|
||||
<div style={{ height: '100vh', width: '100%', position: 'relative' }}>
|
||||
<ReactFlow nodes={nodes} edges={edges} onNodeClick={onNodeClick} onNodeContextMenu={onNodeContextMenu} onNodeDoubleClick={onNodeDoubleClick}>
|
||||
@@ -272,6 +279,7 @@ const NoteFlow = () => {
|
||||
<div
|
||||
key={option.id}
|
||||
onClick={() => handleTabClick(option)}
|
||||
|
||||
style={{
|
||||
padding: '10px',
|
||||
cursor: selectedNodeId === option.id ? 'not-allowed' : 'pointer',
|
||||
|
||||
Reference in New Issue
Block a user