1
0
cvsa/packages/temp_frontend/app/routes/labelling/ControlBar.tsx

53 lines
1.4 KiB
TypeScript

import { Button } from "@/components/ui/button";
import { Check, ChevronLeft, ChevronRight, X } from "lucide-react";
interface ControlBarProps {
currentIndex: number;
videosLength: number;
hasMore: boolean;
onPrevious: () => void;
onNext: () => void;
onLabel: (label: boolean) => void;
}
export function ControlBar({ currentIndex, videosLength, hasMore, onPrevious, onNext, onLabel }: ControlBarProps) {
return (
<div className="fixed bottom-0 left-0 right-0 bg-background border-t p-4 shadow-lg">
<div className="max-w-4xl mx-auto flex items-center justify-between gap-4">
<Button
variant="outline"
onClick={onPrevious}
disabled={currentIndex === 0}
className="flex items-center gap-2"
>
<ChevronLeft className="h-4 w-4" />
</Button>
<div className="flex gap-4">
<Button variant="destructive" onClick={() => onLabel(false)} className="flex items-center gap-2">
<X className="h-4 w-4" />
</Button>
<Button
variant="default"
onClick={() => onLabel(true)}
className="flex items-center gap-2 bg-green-600 hover:bg-green-700"
>
<Check className="h-4 w-4" />
</Button>
</div>
<Button
variant="outline"
onClick={onNext}
disabled={currentIndex === videosLength - 1 && !hasMore}
className="flex items-center gap-2"
>
<ChevronRight className="h-4 w-4" />
</Button>
</div>
</div>
);
}