Files
microsoft--magentic-ui/frontend/src/components/chat/messages/MemorizedFactMessage.tsx
T
wehub-resource-sync 25576b0be6
Checks (magui2.0) / python-lint (push) Failing after 1s
Checks (magui2.0) / python-test (push) Failing after 0s
Checks (magui2.0) / frontend-lint (push) Failing after 0s
CodeQL Advanced / Analyze (actions) (push) Failing after 1s
Checks (magui2.0) / python-format (push) Failing after 1s
CodeQL Advanced / Analyze (python) (push) Failing after 0s
Checks (magui2.0) / python-pyright (push) Failing after 1s
Checks (magui2.0) / frontend-format (push) Failing after 1s
Checks (magui2.0) / frontend-typecheck (push) Failing after 0s
Checks (magui2.0) / frontend-test (push) Failing after 2s
CodeQL Advanced / Analyze (javascript-typescript) (push) Failing after 1s
chore: import upstream snapshot with attribution
2026-07-13 12:24:32 +08:00

37 lines
1.0 KiB
TypeScript

/**
* Memorized Fact Message Component
*
* Renders a `pause_and_memorize_fact` action as a collapsible section,
* mirroring the "Used web browser" header pattern. Header reads
* "Memorized a fact"; expanded body shows the fact text.
*/
import { NotebookPen } from 'lucide-react'
import { CollapsibleHeader } from './CollapsibleHeader'
import { useCollapsibleGroup } from '@/hooks'
export interface MemorizedFactMessageProps {
groupId: string
sessionId: number
fact: string
}
export function MemorizedFactMessage({ groupId, sessionId, fact }: MemorizedFactMessageProps) {
const { isExpanded, toggle } = useCollapsibleGroup(sessionId, groupId, 'toolCall')
return (
<div className="flex w-full flex-col">
<CollapsibleHeader
icon={<NotebookPen className="size-4 shrink-0" />}
label="Memorized a fact"
isExpanded={isExpanded}
onToggle={toggle}
/>
{isExpanded && fact && (
<div className="text-foreground pt-2 pl-6 text-sm break-words">{fact}</div>
)}
</div>
)
}