"use client"; import type { ChatMessage } from "@/lib/types"; import { IntentReceiptCard } from "./IntentReceiptCard"; import { MarkdownLite } from "./MarkdownLite"; import { ComplianceBar } from "./ComplianceBar"; import { SeverityBadge } from "./SeverityBadge"; export function ChatPanel({ messages, loading, }: { messages: ChatMessage[]; loading: boolean; }) { return (
{messages.length === 0 && (

Upload a report, scan a repo, or paste an alert. Get a plain-English briefing, then a remediation plan with{" "} verified allow / block on each step.

)} {messages.map((msg) => (
{msg.role === "user" ? "You" : "SecBrief"} {msg.analysis?.severity && ( )} {msg.meta && ( {msg.meta} )}
{msg.analysis?.summary && (

{msg.analysis.summary}

)} {msg.decisions && msg.decisions.length > 0 && (

Policy check

{msg.decisions.map((d, j) => (
{d.status} {d.action} {d.csrg_path && ( ({d.csrg_path}) )} {" — "} {d.message} {d.in_signed_plan === false && ( · NOT in signed plan )} {d.simulated && ( (demo policy) )}
))}
)} {msg.receipt && }
))} {loading && (
SecBrief is thinking
)}
); }