import { create } from "zustand";
import { devtools, persist } from "zustand/middleware";

interface State {
  name: string;
}

interface Actions {
  setName: (name: string) => void;
}

const useStreamStore = create<State & Actions>()(
  devtools(
    persist(
      (set) => ({
        name: "",
        setName: (name) => set({ name }),
      }),
      {
        name: "auth",
      }
    )
  )
);

export default useStreamStore;
