mirror of
https://github.com/Dispatcharr/Dispatcharr.git
synced 2026-08-02 14:52:15 +00:00
22 lines
436 B
JavaScript
22 lines
436 B
JavaScript
// frontend/src/store/useVideoStore.js
|
|
import { create } from 'zustand';
|
|
|
|
/**
|
|
* Global store to track whether a floating video is visible and which URL is playing.
|
|
*/
|
|
const useVideoStore = create((set) => ({
|
|
isVisible: false,
|
|
streamUrl: null,
|
|
|
|
showVideo: (url) => set({
|
|
isVisible: true,
|
|
streamUrl: url,
|
|
}),
|
|
|
|
hideVideo: () => set({
|
|
isVisible: false,
|
|
streamUrl: null,
|
|
}),
|
|
}));
|
|
|
|
export default useVideoStore;
|