/* eslint-disable @typescript-eslint/no-explicit-any */
import { create } from "zustand";
import { devtools } from "zustand/middleware";
import IUser from "../types/IUser";

interface StreamUserState {
  me: IUser | undefined;
  users: IUser[];
  setMe: (me: IUser | undefined) => void;
  setUsers: (users: IUser[]) => void;
}

const useStreamUserStore = create<StreamUserState>()(
  devtools((set) => ({
    me: undefined,
    users: [],
    setMe: (me) => set({ me }),
    setUsers: (users) => set({ users }),
  }))
);

export default useStreamUserStore;
