summaryrefslogtreecommitdiff
path: root/apps/web/src/stores/properties-store.ts
blob: f45f176d604e40820df0e071f82e1516a0d1e840 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
import { create } from "zustand";

interface ClipEffectsTarget {
	elementId: string;
	trackId: string;
}

interface PropertiesState {
	clipEffectsTarget: ClipEffectsTarget | null;
	openClipEffects: ({ elementId, trackId }: ClipEffectsTarget) => void;
	closeClipEffects: () => void;
}

export const usePropertiesStore = create<PropertiesState>()((set) => ({
	clipEffectsTarget: null,
	openClipEffects: ({ elementId, trackId }) =>
		set({ clipEffectsTarget: { elementId, trackId } }),
	closeClipEffects: () => set({ clipEffectsTarget: null }),
}));