mirror of
https://gh-proxy.org/https://github.com/tiajinsha/JKVideo
synced 2026-07-07 23:18:38 +08:00
20 lines
471 B
TypeScript
20 lines
471 B
TypeScript
import { create } from 'zustand';
|
|
|
|
interface VideoStore {
|
|
isActive: boolean;
|
|
bvid: string;
|
|
title: string;
|
|
cover: string;
|
|
setVideo: (bvid: string, title: string, cover: string) => void;
|
|
clearVideo: () => void;
|
|
}
|
|
|
|
export const useVideoStore = create<VideoStore>(set => ({
|
|
isActive: false,
|
|
bvid: '',
|
|
title: '',
|
|
cover: '',
|
|
setVideo: (bvid, title, cover) => set({ isActive: true, bvid, title, cover }),
|
|
clearVideo: () => set({ isActive: false }),
|
|
}));
|