From 12d26c574b4517f358d97d130b0838f4868a8b85 Mon Sep 17 00:00:00 2001 From: aashishparuvada Date: Mon, 23 Jun 2025 20:05:49 +0530 Subject: enabled-clip-selection --- apps/web/src/stores/timeline-store.ts | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'apps/web/src/stores') diff --git a/apps/web/src/stores/timeline-store.ts b/apps/web/src/stores/timeline-store.ts index c569ae11..ea6fc35e 100644 --- a/apps/web/src/stores/timeline-store.ts +++ b/apps/web/src/stores/timeline-store.ts @@ -21,6 +21,11 @@ export interface TimelineTrack { interface TimelineStore { tracks: TimelineTrack[]; + // Selection + selectedClip: { trackId: string; clipId: string } | null; + selectClip: (trackId: string, clipId: string) => void; + clearSelectedClip: () => void; + // Actions addTrack: (type: "video" | "audio" | "effects") => string; removeTrack: (trackId: string) => void; @@ -50,6 +55,14 @@ interface TimelineStore { export const useTimelineStore = create((set, get) => ({ tracks: [], + selectedClip: null, + + selectClip: (trackId, clipId) => { + set({ selectedClip: { trackId, clipId } }); + }, + clearSelectedClip: () => { + set({ selectedClip: null }); + }, addTrack: (type) => { const newTrack: TimelineTrack = { -- cgit v1.3.1