feat(phase-9): implement MVP polishing and closure
T-032: User management admin panel - backend users router with CRUD, frontend UsersPage with modals T-033: Audit log viewer - backend audit router with filters/pagination, frontend AuditLogPage T-034: Global error handling - ErrorBoundary, LoadingSpinner, ErrorMessage, Toast components T-035: Backend tests - pytest setup with SQLite, tests for health/auth/techniques/tests T-036: Documentation - Updated README with testing section, created docs/API.md
This commit is contained in:
@@ -0,0 +1,40 @@
|
||||
import { AlertCircle, RefreshCw } from "lucide-react";
|
||||
|
||||
interface ErrorMessageProps {
|
||||
title?: string;
|
||||
message?: string;
|
||||
onRetry?: () => void;
|
||||
fullHeight?: boolean;
|
||||
}
|
||||
|
||||
export default function ErrorMessage({
|
||||
title = "Something went wrong",
|
||||
message = "An error occurred while loading this content.",
|
||||
onRetry,
|
||||
fullHeight = true,
|
||||
}: ErrorMessageProps) {
|
||||
return (
|
||||
<div
|
||||
className={`flex flex-col items-center justify-center gap-4 ${
|
||||
fullHeight ? "h-64" : "py-8"
|
||||
}`}
|
||||
>
|
||||
<div className="rounded-full bg-red-900/30 p-4">
|
||||
<AlertCircle className="h-10 w-10 text-red-400" />
|
||||
</div>
|
||||
<div className="text-center">
|
||||
<h3 className="text-lg font-semibold text-white">{title}</h3>
|
||||
<p className="mt-1 text-sm text-gray-400">{message}</p>
|
||||
</div>
|
||||
{onRetry && (
|
||||
<button
|
||||
onClick={onRetry}
|
||||
className="flex items-center gap-2 rounded-lg border border-gray-700 bg-gray-800 px-4 py-2 text-sm text-gray-300 hover:border-cyan-500/50 hover:text-cyan-400 transition-colors"
|
||||
>
|
||||
<RefreshCw className="h-4 w-4" />
|
||||
Try Again
|
||||
</button>
|
||||
)}
|
||||
</div>
|
||||
);
|
||||
}
|
||||
Reference in New Issue
Block a user