mirror of
https://github.com/jhd3197/ServerKit.git
synced 2026-12-04 22:21:21 +09:00
- Standardize toast usage in AgentFleet and FleetMonitor (toast.success/error/info) - Replace inline full-page spinners with PageLoader in CloudProvision, DNSZones, DynamicDns, Marketplace, ServerTemplates, StatusPages - Migrate Servers and Domains tables to DataTable - Migrate DynamicDns create form to FormField - Adopt SearchFilterBar in Applications - Adopt CopyButton in DynamicDns token callout - Replace raw buttons with Button in Servers, Terminal, Docker - Move Domains error-banner close button inline styles to SCSS class - New ErrorState, SearchFilterBar, CopyButton utility components - Add ESLint rules warning on inline styles, raw <button>, and legacy .card divs
33 lines
1.1 KiB
React
33 lines
1.1 KiB
React
import React from '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;
|