This commit is contained in:
2024-08-24 21:28:13 +07:00
parent a11fba1bc1
commit 4ee8206e3e

View File

@@ -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',