import * as React from "react"; import { CheckCircle2, HelpCircle, ChevronRight } from "lucide-react"; import { cn } from "@/lib/utils"; import { Card, CardHeader, CardTitle, CardDescription, CardContent, CardFooter, } from "@/components/ui/card"; import { Button } from "@/components/ui/button"; /** * CopilotDataCard — WealthX DS (Molecule) * * A structured summary the Copilot returns (client / loan / deal snapshot): * a titled card of label→value rows, each optionally tagged with a confidence * marker, plus an optional "view full record" CTA. * * Mirrors the field/confidence pattern of AICollectedDataSection so the two * surfaces stay consistent. Pure display — host wires onView. */ export type CopilotDataConfidence = "confirmed" | "estimated"; export interface CopilotDataField { label: string; value: string; /** Confidence marker. Omit for no marker. */ confidence?: CopilotDataConfidence; } export interface CopilotDataCardProps { /** Card heading, e.g. "Loan snapshot". */ title: string; /** Optional subheading, e.g. "Jordan Avery · #4821". */ subtitle?: string; fields: CopilotDataField[]; /** When provided, renders a CTA in the footer (e.g. open the full record). */ onView?: () => void; viewLabel?: string; className?: string; } export function CopilotDataCard({ title, subtitle, fields, onView, viewLabel = "View full record", className, }: CopilotDataCardProps) { return ( {title} {subtitle && ( {subtitle} )}
{fields.map((field, i) => (
{field.label}
{field.value} {field.confidence === "confirmed" && ( )} {field.confidence === "estimated" && ( )}
))}
{onView && ( )}
); }