Pre-convo UI (#3376)

This commit is contained in:
Jonathan Dobson
2025-09-05 10:08:11 -04:00
committed by GitHub
parent 115c46ff8b
commit 50e0597c84
9 changed files with 156 additions and 133 deletions

View File

@@ -0,0 +1,24 @@
import { create } from "zustand";
type AutoplayStore = {
wpid: string | null;
blockLabel: string | null;
setAutoplay: (wpid: string | null, blockLabel: string | null) => void;
clearAutoplay: () => void;
getAutoplay: () => { wpid: string | null; blockLabel: string | null };
};
export const useAutoplayStore = create<AutoplayStore>((set, get) => ({
wpid: null,
blockLabel: null,
setAutoplay: (wpid: string | null, blockLabel: string | null) => {
set({ wpid, blockLabel });
},
clearAutoplay: () => {
set({ wpid: null, blockLabel: null });
},
getAutoplay: () => {
const { wpid, blockLabel } = get();
return { wpid, blockLabel };
},
}));