export function restoreTextResourceContent(draft?: Record): string[] { const content = draft?.content; if (typeof content === "string") return [content]; // An empty string in the array is an intentional edit and must stay empty. if (Array.isArray(content) && content.length) return content; if (draft?.audioMeta?.outputType === "text" && typeof draft.text === "string") return [draft.text]; return []; }