UNPKG

emv

Version:

EMV / Chip and PIN CLI and library for PC/SC card readers

13 lines 1.3 kB
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime"; import { Box, Text, useInput } from 'ink'; import Gradient from 'ink-gradient'; import { Header, Footer, CardBox } from '../components/index.js'; export function PinResultScreen({ success, message, attemptsLeft, onContinue, }) { useInput((input, key) => { if (key.return || input === ' ') { onContinue(); } }); return (_jsxs(Box, { flexDirection: "column", children: [_jsx(Header, {}), _jsx(CardBox, { title: "PIN Verification Result", children: success ? (_jsxs(Box, { flexDirection: "column", children: [_jsxs(Text, { color: "green", bold: true, children: ["\u2713 ", message] }), _jsx(Text, { children: " " }), _jsxs(Box, { children: [_jsx(Text, { color: "green", children: "\uD83C\uDF89 " }), _jsx(Gradient, { name: "rainbow", children: _jsx(Text, { bold: true, children: "PIN Verified Successfully!" }) })] })] })) : (_jsxs(Box, { flexDirection: "column", children: [_jsxs(Text, { color: "red", bold: true, children: ["\u2717 ", message] }), attemptsLeft !== undefined && (_jsxs(Text, { color: "yellow", children: ["Attempts remaining: ", attemptsLeft] }))] })) }), _jsx(Footer, { hints: [{ keys: 'Enter', description: 'Continue' }] })] })); } //# sourceMappingURL=PinResultScreen.js.map