"use client"; import { ChatMessageContent } from "@/components/chat-message-content"; import { AgentAvatar } from "@/components/chat-message-row"; import { protectOnboardingPhrases } from "@/lib/onboarding-copy"; import type { Message } from "@/lib/home-types"; export function OnboardingChatMessage({ role, text, streaming = false, length = text.length, phraseSafe = false }: { role: Message["role"]; text: string; streaming?: boolean; length?: number; phraseSafe?: boolean }) { const visibleText = streaming ? text.slice(0, length) : text; const protectedVisibleText = protectOnboardingPhrases(visibleText); return (
{role === "assistant" && }
{role === "assistant" ? ( streaming ? ( <>
= text.length ? "is-complete" : ""}`} aria-hidden="true">
{length >= text.length ? text : ""} ) : ) :

{protectedVisibleText}

}
); }