"use client";

const CHATS_INITIALIZED_KEY = "chats-initialized";

export const chatsService = {
  isChatsInitialized: (): boolean => {
    if (typeof window === "undefined") return false;
    return localStorage.getItem(CHATS_INITIALIZED_KEY) === "true";
  },

  setChatsInitialized: (): void => {
    if (typeof window === "undefined") return;
    localStorage.setItem(CHATS_INITIALIZED_KEY, "true");
  },

  clearChatsInitialized: (): void => {
    if (typeof window === "undefined") return;
    localStorage.removeItem(CHATS_INITIALIZED_KEY);
  },
};
