tahamajs/IE / Projects /front /src /components /admin /AdminLoadingError.tsx
tahamajs's picture
download
raw
992 Bytes
// src/components/admin/AdminLoadingError.tsx
import { Loader2, AlertCircle, RefreshCw } from "lucide-react";
interface AdminLoadingErrorProps {
loading: boolean;
error: string;
onRetry: () => void;
children: React.ReactNode;
}
export function AdminLoadingError({ loading, error, onRetry, children }: AdminLoadingErrorProps) {
if (loading) {
return (
<div className="flex items-center justify-center py-12">
<Loader2 className="w-8 h-8 animate-spin text-primary" />
</div>
);
}
if (error) {
return (
<div className="flex flex-col items-center justify-center py-12 text-center">
<AlertCircle className="w-12 h-12 text-red-500 mb-4" />
<p className="text-gray-600 mb-4">{error}</p>
<button onClick={onRetry} className="inline-flex items-center gap-2 px-4 py-2 bg-primary text-white rounded-lg">
<RefreshCw className="w-4 h-4" /> Retry
</button>
</div>
);
}
return <>{children}</>;
}

Xet Storage Details

Size:
992 Bytes
·
Xet hash:
804fae253f8cff0e3ac82af02a652eddcd8231ab418fc878737ca8310dc33438

Xet efficiently stores files, intelligently splitting them into unique chunks and accelerating uploads and downloads. More info.