import React from 'react';

interface ErrorBannerProps {
  message?: string;
  onRetry?: () => void;
}

const ErrorBanner = ({ message, onRetry }: ErrorBannerProps): JSX.Element => (
  <div className="rounded-lg border border-red-200 bg-red-50 p-4">
    <p className="text-sm font-medium text-red-800">
      {message || 'Failed to load data'}
    </p>
    {onRetry && (
      <button
        onClick={onRetry}
        className="mt-2 text-sm text-red-600 underline hover:text-red-800"
      >
        Retry
      </button>
    )}
  </div>
);

export default ErrorBanner;
