import { useState } from 'react'; import { MarkdownViewer } from '@renderer/components/chat/viewers/MarkdownViewer'; import { MemberBadge } from '@renderer/components/team/MemberBadge'; import type { ParsedMessageReply } from '@renderer/utils/agentMessageFormatting'; interface ReplyQuoteBlockProps { reply: ParsedMessageReply; /** Color name for the quoted agent (resolved from memberColorMap). */ memberColor?: string; /** When set, limits height of the reply body (e.g. "max-h-56"). Omit to show full content. */ bodyMaxHeight?: string; } /** Threshold (characters) above which the "more/less" toggle is shown. */ const LONG_QUOTE_THRESHOLD = 200; export const ReplyQuoteBlock = ({ reply, memberColor, bodyMaxHeight = 'max-h-56', }: ReplyQuoteBlockProps): React.JSX.Element => { const isLong = reply.originalText.length > LONG_QUOTE_THRESHOLD; const [expanded, setExpanded] = useState(false); const quoteMaxHeight = expanded ? 'max-h-48' : 'max-h-[3.75rem]'; return (
{/* Quote block — styled like SendMessageDialog */}
{/* Decorative quotation mark */} {/* "Replying to" + MemberBadge */}
Replying to
{/* Quote text */}
{/* More/less toggle */} {isLong ? ( ) : null}
{/* Reply text */}
); };