"use client";

import Alert from '@/components/ui/alert/Alert';
import { RefreshCw } from 'lucide-react';
import Button from '@/components/ui/button/Button';

interface SessionErrorDisplayProps {
  error: string;
  onRetry?: () => void;
}

export function SessionErrorDisplay({ error, onRetry }: SessionErrorDisplayProps) {
  return (
    <div className="mx-auto max-w-4xl space-y-4 mb-8">
      <Alert
        variant="error"
        title="Gagal Memuat Data Session"
        message={error || "Terjadi kesalahan saat memuat data session. Silakan coba lagi."}
      />
      {onRetry && (
        <div className="flex justify-center">
          <Button
            onClick={onRetry}
            startIcon={<RefreshCw className="w-4 h-4" />}
          >
            Coba Lagi
          </Button>
        </div>
      )}
    </div>
  );
}

