"use client"; import { Button } from "@/components/ui/button"; import { cn } from "@/lib/utils"; import { CATEGORY_STYLES, formatCurrency } from "@/lib/crm"; import type { ProductCategory } from "@/lib/crm"; interface QuoteLineItem { productId: string; name: string; category: ProductCategory; qty: number; unitPrice: number; lineTotal: number; photoUrl: string; } export interface QuoteResult { accountId: string; accountName: string; useCase?: string; seats?: number; lineItems: QuoteLineItem[]; subtotal: number; note: string; } export function QuoteCard({ result, status, onApprove, onAddToDeal, }: { result?: QuoteResult; status: string; onApprove?: (quote: QuoteResult) => void; onAddToDeal?: () => void; }) { if (status !== "complete") { return (
Building a hardware quote…
); } if (!result || !Array.isArray(result.lineItems)) { return (
A quote isn’t available right now.
); } const subtitleBits = [ result.useCase, typeof result.seats === "number" ? `${result.seats} seats` : undefined, ].filter(Boolean) as string[]; return (
Hardware quote
{result.accountName}
{subtitleBits.length > 0 && (
{subtitleBits.join(" · ")}
)}
Subtotal {formatCurrency(result.subtotal)}
{result.note && (

{result.note}

)} {(onApprove || onAddToDeal) && (
{onApprove && ( )} {onAddToDeal && ( )}
)}
); }