mirror of
https://github.com/jhd3197/ServerKit.git
synced 2026-10-30 16:47:01 +09:00
Per docs/plans/FRONTEND_UX_TAILWIND_CLEANUP_PLAN.md §8.5. React 18's automatic JSX runtime makes 'import React' unnecessary; removed it from the 142 files eslint flagged as 'React defined but never used' (named imports like useState preserved). Driven by an eslint --format json pass so only flagged files were touched. Lint warnings: 1603 -> 1461 (0 errors). Verified: npm run build passes. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
32 lines
1.0 KiB
React
32 lines
1.0 KiB
React
import { AlertTriangle, RefreshCw } from 'lucide-react';
|
|
import { Button } from '@/components/ui/button';
|
|
|
|
/**
|
|
* Consistent error state for pages and panels. Shows an icon, title, message,
|
|
* and optional retry action.
|
|
*
|
|
* <ErrorState
|
|
* title="Failed to load servers"
|
|
* message="The backend returned an error. Please try again."
|
|
* onRetry={loadData}
|
|
* />
|
|
*/
|
|
export function ErrorState({ title = 'Something went wrong', message, onRetry, className = '' }) {
|
|
return (
|
|
<div className={`sk-error-state ${className}`.trim()}>
|
|
<div className="sk-error-state__icon">
|
|
<AlertTriangle size={32} />
|
|
</div>
|
|
<h3 className="sk-error-state__title">{title}</h3>
|
|
{message && <p className="sk-error-state__message">{message}</p>}
|
|
{onRetry && (
|
|
<Button variant="outline" size="sm" onClick={onRetry}>
|
|
<RefreshCw size={14} /> Try again
|
|
</Button>
|
|
)}
|
|
</div>
|
|
);
|
|
}
|
|
|
|
export default ErrorState;
|