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 {
background: #ffb38a;
}
.clean-btn{
background: #ff8a8a;
}
@@ -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
</button>
<button
className='control-btn clean-btn'
onClick={onDeleteAll}
title='DeleteAll'
>
<MdCleaningServices /> Delete All
</button>
</div>
</div>
);
@@ -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}
/>
</div>
</div>