import { formatAmount } from "@/lib/format"
import { cn } from "@/lib/utils"

interface ReportSubtotalProps {
  label: string
  amount: number
  large?: boolean
}

/** A bold, unbordered subtotal/total line (Gross Profit, Net Cash From Operations, the final total, etc.). */
export function ReportSubtotal({ label, amount, large }: ReportSubtotalProps) {
  return (
    <div
      className={cn(
        "mb-4 flex items-center justify-between rounded-lg bg-muted/40 px-4 py-3 font-bold",
        large && "text-lg"
      )}
    >
      <span>{label}</span>
      <span className="tabular-nums">{formatAmount(amount)}</span>
    </div>
  )
}
