diff --git a/.gitignore b/.gitignore index a547bf3..df6c709 100644 --- a/.gitignore +++ b/.gitignore @@ -22,3 +22,11 @@ dist-ssr *.njsproj *.sln *.sw? + +# Test runner directories +/coverage +/.nyc_output + +# Test artifacts +/tests/__pycache__ +__pycache__/ diff --git a/src/App.css b/src/App.css index b9d355d..9fd2ae4 100644 --- a/src/App.css +++ b/src/App.css @@ -5,6 +5,21 @@ text-align: center; } +.clear-button { + padding: 10px 20px; + background-color: #f44336; + color: white; + border: none; + border-radius: 8px; + font-weight: bold; + cursor: pointer; +} + +.clear-button:disabled { + cursor: not-allowed; + opacity: 0.7; +} + .logo { height: 6em; padding: 1.5em; diff --git a/src/App.jsx b/src/App.jsx index 5f3df15..ff7a6a0 100644 --- a/src/App.jsx +++ b/src/App.jsx @@ -161,6 +161,13 @@ export default function App() { setLoading(false); }; + const handleClear = () => { + if (window.confirm('Are you sure you want to clear the mind map?')) { + setNodes(initialNodes); + setEdges(initialEdges); + } + }; + const onNodeClick = async (_event, node) => { stopGenerationRef.current = false; setLoading(true); @@ -246,6 +253,13 @@ export default function App() { > Export as PNG +