import { create } from "zustand";

type State = {
  token: string;
};

type Actions = {
  setToken: (token: string) => void;
};

// define the initial state
const initialState: State = {
  token: "",
};

// create store
const useRealtimeToken = create<State & Actions>()((set, get) => ({
  ...initialState,
  setToken: (token: string) => {
    set({ token });
  },
}));

export { useRealtimeToken };
