import { Button } from "../../ui/button"; import { Scissors, ArrowLeftToLine, ArrowRightToLine, Trash2, Snowflake, Copy, SplitSquareHorizontal, Pause, Play, Lock, LockOpen, } from "lucide-react"; import { Tooltip, TooltipContent, TooltipTrigger, TooltipProvider, } from "../../ui/tooltip"; import { useTimelineStore } from "@/stores/timeline-store"; import { usePlaybackStore } from "@/stores/playback-store"; import { TIMELINE_CONSTANTS } from "@/constants/timeline-constants"; export interface TimelineToolbarProps { handleSplitSelected: () => void; handleSplitAndKeepLeft: () => void; handleSplitAndKeepRight: () => void; handleSeparateAudio: () => void; handleDuplicateSelected: () => void; handleFreezeSelected: () => void; handleDeleteSelected: () => void; } export function TimelineToolbar({ handleSplitSelected, handleSplitAndKeepLeft, handleSplitAndKeepRight, handleSeparateAudio, handleDuplicateSelected, handleFreezeSelected, handleDeleteSelected, }: TimelineToolbarProps) { const { tracks, addTrack, addElementToTrack, snappingEnabled, toggleSnapping, } = useTimelineStore(); const { currentTime, duration, isPlaying, toggle } = usePlaybackStore(); return (
{isPlaying ? "Pause (Space)" : "Play (Space)"}
{currentTime.toFixed(1)}s / {duration.toFixed(1)}s
{tracks.length === 0 && ( <>
Add a test clip to try playback )}
Split element (Ctrl+S) Split and keep left (Ctrl+Q) Split and keep right (Ctrl+W) Separate audio (Ctrl+D) Duplicate element (Ctrl+D) Freeze frame (F) Delete element (Delete)
Auto snapping
); }