import type { ChatConversationSummary } from './types';

export function normalizeConversationDraftText(value: string | null | undefined) {
  return typeof value === 'string' ? value : '';
}

export function updateConversationDraftText(
  items: ChatConversationSummary[],
  sessionId: string,
  draftText: string,
) {
  return items.map((item) => (item.sessionId === sessionId ? { ...item, draftText } : item));
}
