summaryrefslogtreecommitdiff
path: root/apps/web/src/stores
diff options
context:
space:
mode:
authoriza <59828082+izadoesdev@users.noreply.github.com>2025-06-23 17:49:20 +0300
committerGitHub <noreply@github.com>2025-06-23 17:49:20 +0300
commitc8f92a76e30fba860b30a9b528e5b42291d2d54a (patch)
treec2101ee046b5c557ff343ec4ee2b7e3c1d55d6ae /apps/web/src/stores
parent14a720256f6cd17aca0e3e150ddef7977f46a4e1 (diff)
parent12d26c574b4517f358d97d130b0838f4868a8b85 (diff)
downloadopencut-c8f92a76e30fba860b30a9b528e5b42291d2d54a.tar.gz
Merge pull request #16 from aashishparuvada/main
enabled-clip-selection-and-deletion
Diffstat (limited to 'apps/web/src/stores')
-rw-r--r--apps/web/src/stores/timeline-store.ts13
1 files changed, 13 insertions, 0 deletions
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<TimelineStore>((set, get) => ({
tracks: [],
+ selectedClip: null,
+
+ selectClip: (trackId, clipId) => {
+ set({ selectedClip: { trackId, clipId } });
+ },
+ clearSelectedClip: () => {
+ set({ selectedClip: null });
+ },
addTrack: (type) => {
const newTrack: TimelineTrack = {