/**
 * 聊天列表项 discriminated union
 *
 * 
 *
 * 4 种类型：
 *   - ai-disclosure：顶部 AI 披露横幅
 *   - date-separator：日期分隔条
 *   - loading-animation：AI 正在输入的动画
 *   - message：实际消息
 */
import type { UiMessage } from "./ui_message";

export type ChatListItem =
  | { type: "ai-disclosure" }
  | { type: "date-separator"; date: string }
  | { type: "loading-animation" }
  | { type: "message"; message: UiMessage; key: string };

export const ChatListItemType = {
  AiDisclosure: "ai-disclosure",
  DateSeparator: "date-separator",
  LoadingAnimation: "loading-animation",
  Message: "message",
} as const;

export type ChatListItemType =
  (typeof ChatListItemType)[keyof typeof ChatListItemType];
