chore: import DH V2 D5.6.4 production baseline
This commit is contained in:
@@ -0,0 +1,17 @@
|
||||
import { ApiError } from '../lib/api';
|
||||
|
||||
export function errorMessage(error: unknown) {
|
||||
return error instanceof ApiError ? error.message : 'No se pudo completar la operación';
|
||||
}
|
||||
|
||||
export function LoadingBlock({ label = 'Cargando…' }: { label?: string }) {
|
||||
return <div className="loading-block"><span className="spinner" />{label}</div>;
|
||||
}
|
||||
|
||||
export function EmptyState({ title, text }: { title: string; text: string }) {
|
||||
return <div className="empty-state"><strong>{title}</strong><p>{text}</p></div>;
|
||||
}
|
||||
|
||||
export function Alert({ type = 'error', children }: { type?: 'error' | 'success' | 'info'; children: React.ReactNode }) {
|
||||
return <div className={`alert-box ${type}`}>{children}</div>;
|
||||
}
|
||||
Reference in New Issue
Block a user