import { create } from "zustand";

interface messageState {
  messages: Array<{
    user: boolean;
    content: string;
    withDeepResearch: boolean;
  }>;
  pushMessage: (newMessage: {
    user: boolean;
    content: string;
    withDeepResearch: boolean;
  }) => void;
  resetConversation: () => void;
}

export const messageStore = create<messageState>()((set) => ({
  messages: [],
  pushMessage: (newMessage) =>
    set((state) => ({ messages: [...state.messages, newMessage] })),
  resetConversation: () => set(() => ({ messages: [] })),
}));
