UNPKG

pagamio-frontend-commons-lib

Version:

Pagamio library for Frontend reusable components like the form engine and table container

6 lines (5 loc) 931 B
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime"; const ErrorState = ({ error, onRetry }) => { return (_jsxs("div", { className: "flex flex-col items-center justify-center space-y-2 py-4", children: [_jsx("div", { className: "text-red-500 mb-2", children: _jsx("svg", { className: "w-8 h-8", fill: "none", stroke: "currentColor", viewBox: "0 0 24 24", children: _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M12 9v2m0 4h.01m-6.938 4h13.856c1.54 0 2.502-1.667 1.732-3L13.732 4c-.77-1.333-2.694-1.333-3.464 0L3.34 16c-.77 1.333.192 3 1.732 3z" }) }) }), _jsx("p", { className: "text-sm text-gray-600 text-center", children: error.message ?? 'Failed to fetch data' }), onRetry && (_jsx("button", { onClick: onRetry, className: "mt-2 px-4 py-2 text-sm text-white bg-blue-500 rounded hover:bg-blue-600 transition-colors", children: "Retry" }))] })); }; export default ErrorState;