summaryrefslogtreecommitdiff
path: root/apps/web/src/components
diff options
context:
space:
mode:
authorMaze Winther <mazewinther@gmail.com>2025-07-09 22:17:05 +0200
committerMaze Winther <mazewinther@gmail.com>2025-07-09 22:17:05 +0200
commitdb8cd93a99faa0183ed0ade5d9bac0fd7e307d48 (patch)
treee33e0bdfb779bc9ad01af561b2ac8226598f9ffe /apps/web/src/components
parent27d65ca7c50a2394874d2837b5f0a6fd9ec8f5b2 (diff)
downloadopencut-db8cd93a99faa0183ed0ade5d9bac0fd7e307d48.tar.gz
style: replace track color circle with icon in timeline
Diffstat (limited to 'apps/web/src/components')
-rw-r--r--apps/web/src/components/editor/timeline.tsx32
1 files changed, 21 insertions, 11 deletions
diff --git a/apps/web/src/components/editor/timeline.tsx b/apps/web/src/components/editor/timeline.tsx
index 3c8315db..bec5ec05 100644
--- a/apps/web/src/components/editor/timeline.tsx
+++ b/apps/web/src/components/editor/timeline.tsx
@@ -10,10 +10,11 @@ import {
Snowflake,
Copy,
SplitSquareHorizontal,
- Volume2,
- VolumeX,
Pause,
Play,
+ Video,
+ Music,
+ TypeIcon,
} from "lucide-react";
import {
Tooltip,
@@ -25,7 +26,6 @@ import {
ContextMenu,
ContextMenuContent,
ContextMenuItem,
- ContextMenuSeparator,
ContextMenuTrigger,
} from "../ui/context-menu";
import { useTimelineStore } from "@/stores/timeline-store";
@@ -44,9 +44,8 @@ import {
SelectValue,
} from "../ui/select";
import { TimelineTrackContent } from "./timeline-track";
-import type { DragData } from "@/types/timeline";
+import type { DragData, TimelineTrack } from "@/types/timeline";
import {
- getTrackLabelColor,
getTrackHeight,
getCumulativeHeightBefore,
getTotalTracksHeight,
@@ -1008,12 +1007,7 @@ export function Timeline() {
style={{ height: `${getTrackHeight(track.type)}px` }}
>
<div className="flex items-center flex-1 min-w-0">
- <div
- className={`w-3 h-3 rounded-full flex-shrink-0 ${getTrackLabelColor(track.type)}`}
- />
- <span className="ml-2 text-sm font-medium truncate">
- {track.name}
- </span>
+ <TrackIcon track={track} />
</div>
{track.muted && (
<span className="ml-2 text-xs text-red-500 font-semibold flex-shrink-0">
@@ -1100,3 +1094,19 @@ export function Timeline() {
</div>
);
}
+
+function TrackIcon({ track }: { track: TimelineTrack }) {
+ return (
+ <>
+ {track.type === "media" && (
+ <Video className="w-4 h-4 flex-shrink-0 text-muted-foreground" />
+ )}
+ {track.type === "text" && (
+ <TypeIcon className="w-4 h-4 flex-shrink-0 text-muted-foreground" />
+ )}
+ {track.type === "audio" && (
+ <Music className="w-4 h-4 flex-shrink-0 text-muted-foreground" />
+ )}
+ </>
+ );
+}