"use client";

import { cn } from "@/lib/utils";

export function DashboardCardExcludeHint({
  excludeCount,
  deductionLabel,
  deductionFormatted,
  className,
}: {
  excludeCount?: number | null;
  deductionLabel?: string | null;
  deductionFormatted?: string | null;
  className?: string;
}) {
  const notes: string[] = [];

  if (excludeCount && excludeCount > 0) {
    notes.push(
      `*excluding ${excludeCount} transaction${excludeCount === 1 ? "" : "s"}`,
    );
  }

  if (deductionFormatted) {
    notes.push(`Excl. ${deductionLabel ?? "adjustment"}: ${deductionFormatted}`);
  }

  if (notes.length === 0) return null;

  return (
    <div className={cn("space-y-0.5", className)}>
      {notes.map((note) => (
        <p
          key={note}
          className="text-[9px] leading-none text-amber-600 dark:text-amber-400"
        >
          {note}
        </p>
      ))}
    </div>
  );
}
