summaryrefslogtreecommitdiff
path: root/apps/web/src/components/editor/timeline/index.tsx
diff options
context:
space:
mode:
authorMaze Winther <mazewinther@gmail.com>2025-08-13 17:05:17 +0200
committerMaze Winther <mazewinther@gmail.com>2025-08-13 17:05:17 +0200
commit0274fb662647630803598e01c975e6b1439922ab (patch)
tree5cb90f172e8c47cb8db6a2d24bd6fed2163ca08a /apps/web/src/components/editor/timeline/index.tsx
parent0ae09c9df5591e2d18991a9f98647826997fe740 (diff)
downloadopencut-0274fb662647630803598e01c975e6b1439922ab.tar.gz
cleanup
Diffstat (limited to 'apps/web/src/components/editor/timeline/index.tsx')
-rw-r--r--apps/web/src/components/editor/timeline/index.tsx20
1 files changed, 7 insertions, 13 deletions
diff --git a/apps/web/src/components/editor/timeline/index.tsx b/apps/web/src/components/editor/timeline/index.tsx
index 669d556c..d8261d9b 100644
--- a/apps/web/src/components/editor/timeline/index.tsx
+++ b/apps/web/src/components/editor/timeline/index.tsx
@@ -1,6 +1,5 @@
"use client";
-import React from "react";
import { ScrollArea } from "@/components/ui/scroll-area";
import { Button } from "../../ui/button";
import {
@@ -609,7 +608,11 @@ export function Timeline() {
onMouseEnter={() => setIsInTimeline(true)}
onMouseLeave={() => setIsInTimeline(false)}
>
- <TimelineToolbar zoomLevel={zoomLevel} setZoomLevel={setZoomLevel} seek={seek} />
+ <TimelineToolbar
+ zoomLevel={zoomLevel}
+ setZoomLevel={setZoomLevel}
+ seek={seek}
+ />
{/* Timeline Container */}
<div
@@ -959,7 +962,6 @@ function TimelineToolbar({
const { currentTime, duration, isPlaying, toggle } = usePlaybackStore();
const { toggleBookmark, isBookmarked } = useProjectStore();
- // Action handlers
const handleSplitSelected = () => {
if (selectedElements.length === 0) return;
let splitCount = 0;
@@ -1075,7 +1077,6 @@ function TimelineToolbar({
clearSelectedElements();
};
- // Zoom handlers
const handleZoomIn = () => {
setZoomLevel(Math.min(4, zoomLevel + 0.25));
};
@@ -1092,13 +1093,11 @@ function TimelineToolbar({
await toggleBookmark(currentTime);
};
- // Check if the current time is bookmarked
const currentBookmarked = isBookmarked(currentTime);
return (
<div className="border-b flex items-center justify-between px-2 py-1">
<div className="flex items-center gap-1 w-full">
<TooltipProvider delayDuration={500}>
- {/* Play/Pause Button */}
<Tooltip>
<TooltipTrigger asChild>
<Button
@@ -1118,31 +1117,26 @@ function TimelineToolbar({
{isPlaying ? "Pause (Space)" : "Play (Space)"}
</TooltipContent>
</Tooltip>
- {/* Return to Start Button - Seeks timeline to 00:00:00 */}
<Tooltip>
<TooltipTrigger asChild>
<Button
variant="text"
size="icon"
- onClick={() => seek(0)} // Seek to timeline start position
+ onClick={() => seek(0)}
className="mr-2"
>
<SkipBack className="h-4 w-4" />
</Button>
</TooltipTrigger>
- <TooltipContent>
- Return to Start (Home / Enter)
- </TooltipContent>
+ <TooltipContent>Return to Start (Home / Enter)</TooltipContent>
</Tooltip>
<div className="w-px h-6 bg-border mx-1" />
- {/* Time Display */}
<div
className="text-xs text-muted-foreground font-mono px-2"
style={{ minWidth: "18ch", textAlign: "center" }}
>
{currentTime.toFixed(1)}s / {duration.toFixed(1)}s
</div>
- {/* Test Clip Button - for debugging */}
{tracks.length === 0 && (
<>
<div className="w-px h-6 bg-border mx-1" />