add delete all btn

This commit is contained in:
Armen Rohalov
2025-05-01 22:54:52 +03:00
parent af729ed7ad
commit 1e1e8ae97d
3 changed files with 21 additions and 3 deletions
@@ -55,3 +55,7 @@
.delete-btn { .delete-btn {
background: #ffb38a; background: #ffb38a;
} }
.clean-btn{
background: #ff8a8a;
}
@@ -1,5 +1,6 @@
import { Slider } from '@mui/material'; import { Slider } from '@mui/material';
import { FaStop } from "react-icons/fa"; import { FaStop } from "react-icons/fa";
import { MdCleaningServices } from "react-icons/md";
import './AnnotationControls.css'; import './AnnotationControls.css';
function AnnotationControls({ function AnnotationControls({
@@ -11,7 +12,8 @@ function AnnotationControls({
onFrameForward, onFrameForward,
onSaveAnnotation, onSaveAnnotation,
onStop, onStop,
onDelete onDelete,
onDeleteAll
}) { }) {
function formatDuration(value) { function formatDuration(value) {
@@ -87,6 +89,13 @@ function AnnotationControls({
> >
🗑 Delete 🗑 Delete
</button> </button>
<button
className='control-btn clean-btn'
onClick={onDeleteAll}
title='DeleteAll'
>
<MdCleaningServices /> Delete All
</button>
</div> </div>
</div> </div>
); );
@@ -99,6 +99,10 @@ function AnnotationMain() {
setErrorMessage(""); setErrorMessage("");
}; };
const handleDeleteAll = () => {
setDetections([]);
}
const handleAnnotationClick = (time) => { const handleAnnotationClick = (time) => {
setCurrentTime(time); setCurrentTime(time);
const annotation = annotations[time]; const annotation = annotations[time];
@@ -225,6 +229,7 @@ function AnnotationMain() {
onSaveAnnotation={handleAnnotationSave} onSaveAnnotation={handleAnnotationSave}
onStop={handleStop} onStop={handleStop}
onDelete={handleDelete} onDelete={handleDelete}
onDeleteAll={handleDeleteAll}
/> />
</div> </div>
</div> </div>