diff --git a/src/components/AnnotationControls/AnnotationControls.css b/src/components/AnnotationControls/AnnotationControls.css index 1ad9b03..d09d26b 100644 --- a/src/components/AnnotationControls/AnnotationControls.css +++ b/src/components/AnnotationControls/AnnotationControls.css @@ -54,4 +54,8 @@ .delete-btn { background: #ffb38a; +} + +.clean-btn{ + background: #ff8a8a; } \ No newline at end of file diff --git a/src/components/AnnotationControls/AnnotationControls.js b/src/components/AnnotationControls/AnnotationControls.js index a01c7d3..40f5b46 100644 --- a/src/components/AnnotationControls/AnnotationControls.js +++ b/src/components/AnnotationControls/AnnotationControls.js @@ -1,5 +1,6 @@ import { Slider } from '@mui/material'; import { FaStop } from "react-icons/fa"; +import { MdCleaningServices } from "react-icons/md"; import './AnnotationControls.css'; function AnnotationControls({ @@ -11,7 +12,8 @@ function AnnotationControls({ onFrameForward, onSaveAnnotation, onStop, - onDelete + onDelete, + onDeleteAll }) { function formatDuration(value) { @@ -87,6 +89,13 @@ function AnnotationControls({ > 🗑️ Delete + ); diff --git a/src/components/AnnotationMain/AnnotationMain.js b/src/components/AnnotationMain/AnnotationMain.js index 79e215b..c4cb491 100644 --- a/src/components/AnnotationMain/AnnotationMain.js +++ b/src/components/AnnotationMain/AnnotationMain.js @@ -79,9 +79,9 @@ function AnnotationMain() { ...annotations, [currentTime]: { time: currentTime, annotations: detections, imageData } }; - + setAnnotations(newAnnotations); - + saveAnnotation(currentTime, detections, imageData); setErrorMessage(""); } @@ -99,6 +99,10 @@ function AnnotationMain() { setErrorMessage(""); }; + const handleDeleteAll = () => { + setDetections([]); + } + const handleAnnotationClick = (time) => { setCurrentTime(time); const annotation = annotations[time]; @@ -225,6 +229,7 @@ function AnnotationMain() { onSaveAnnotation={handleAnnotationSave} onStop={handleStop} onDelete={handleDelete} + onDeleteAll={handleDeleteAll} />