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

/** Signed % away value with rose/emerald coloring (cashflow + structure views). */
export function CashflowAwayCell({
  value,
  negative,
}: {
  value: string | null;
  negative: boolean | null;
}) {
  if (!value) return <span className="text-muted-foreground">—</span>;
  const isNeg = negative ?? value.trim().startsWith("-");
  return (
    <span
      className={cn(
        "font-medium tabular-nums",
        isNeg ? "text-rose-600 dark:text-rose-400" : "text-emerald-600 dark:text-emerald-400",
      )}
    >
      {value}
    </span>
  );
}
