import { RefreshCw } from "lucide-react";

interface CashReportActionsProps {
  isLoading: boolean;
  onRefresh: () => void;
}

export const CashReportActions = ({ isLoading, onRefresh }: CashReportActionsProps) => {
  const btnClass = isLoading
    ? "inline-flex items-center gap-2 rounded-lg border border-gray-200 bg-gray-100 px-3 py-1.5 text-xs font-medium text-gray-500 cursor-not-allowed shadow-sm"
    : "inline-flex items-center gap-2 rounded-lg border border-[#428B4D]/40 bg-white px-3 py-1.5 text-xs font-semibold text-slate-700 shadow-sm hover:-translate-y-0.5 hover:border-[#428B4D] hover:bg-[#428B4D] hover:text-white active:scale-95 transition-all duration-200";

  return (
    <button onClick={onRefresh} disabled={isLoading} className={btnClass}>
      <RefreshCw className={isLoading ? "h-4 w-4 animate-spin" : "h-4 w-4"} />
      {isLoading ? "Refreshing…" : "Refresh"}
    </button>
  );
};
