'use client';

import { Button } from '@/components/ui/shared/Button';

interface TodayLoadErrorBannerProps {
  message: string;
  retryLabel: string;
  onRetry: () => void;
  isRetrying?: boolean;
}

export function TodayLoadErrorBanner({
  message,
  retryLabel,
  onRetry,
  isRetrying = false,
}: TodayLoadErrorBannerProps) {
  return (
    <div className="rounded-[var(--radius-md)] border border-badge-danger-border bg-badge-danger-bg/40 p-4 flex flex-col sm:flex-row sm:items-center sm:justify-between gap-3">
      <p className="text-sm text-badge-danger-fg">{message}</p>
      <Button
        type="button"
        variant="outline"
        size="sm"
        onClick={onRetry}
        isLoading={isRetrying}
        className="shrink-0 border-badge-danger-border text-badge-danger-fg hover:bg-badge-danger-bg/30"
      >
        {retryLabel}
      </Button>
    </div>
  );
}
