UNPKG

@letanure/resend-cli

Version:

A command-line interface for Resend email API

20 lines 1.06 kB
import { jsx as _jsx } from "react/jsx-runtime"; import { Box, useInput } from 'ink'; import { ErrorDisplay } from './ErrorDisplay.js'; import { Layout } from './layout.js'; /** * Standardized error screen component that provides consistent error display * across all modules. Replaces the need for custom error layouts. */ export const ErrorScreen = ({ title = 'Error', message, suggestion, headerText, onExit, showRetry = false, onRetry, }) => { useInput((input, key) => { if (input === 'q' || key.escape || key.leftArrow) { onExit(); } if (showRetry && onRetry && (input === 'r' || key.return)) { onRetry(); } }); return (_jsx(Layout, { headerText: headerText, showNavigationInstructions: true, navigationContext: showRetry && onRetry ? 'error-retry' : 'result', children: _jsx(Box, { flexDirection: "column", children: _jsx(Box, { marginBottom: 1, children: _jsx(ErrorDisplay, { title: title, message: message, suggestion: suggestion }) }) }) })); }; //# sourceMappingURL=ErrorScreen.js.map