// src/types/conversation.ts

import { ChatConversationItem } from "./chatConversation";
import { ImageConversationItem } from "./imageConversation";
import { SVGConversationItem } from "./svgConversation";

/**
 * 定义所有对话项的公共基础接口
 */
export interface BaseConversationItem {
  conversationId: string;
  userId: number;
  startedAt: string; // ISO 时间格式字符串
  endedAt: string | null; // 可能为 null
  status: "ongoing" | "completed" | "closed"; // 你可以根据业务扩展更多状态
  messages: string;
  title:string;//会话标题
  messageId: number;
  type: number; // 用作判别字段
}

/**
 * 联合类型，用于处理所有对话项
 */
export type ConversationItem =
  | ChatConversationItem
  | ImageConversationItem
  | SVGConversationItem;

export interface ConversationState {
  conversationId: string;
  isReadyNewConversation: boolean;
}
