import { writable } from "svelte/store";

// Default to chat mode
const messageModeStore = writable<string>("chat");

export const messageMode = {
  subscribe: messageModeStore.subscribe,
  set: (mode: string) => {
    messageModeStore.set(mode);
  },
  reset: () => messageModeStore.set("chat"),
};

// Helper to get current mode
export function getCurrentMode(): string {
  let currentMode = "chat";
  messageMode.subscribe((mode) => (currentMode = mode))();
  return currentMode;
}
