File size: 2,040 Bytes
1e24842
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
import React from 'react';
import { Zap, X } from 'lucide-react';

export default function OtpModal({ otpPrompt, otpInput, setOtpInput, onSubmit, onCancel }) {
  return (
    <div style={{ position: 'fixed', inset: 0, zIndex: 50, display: 'flex', alignItems: 'center', justifyContent: 'center', background: 'rgba(0,0,0,0.7)', backdropFilter: 'blur(8px)', padding: 16 }}>
      <div style={{ background: 'var(--bg-1)', border: '1px solid var(--line-3)', borderRadius: 10, width: '100%', maxWidth: 420, overflow: 'hidden', boxShadow: 'var(--shadow-md)' }}>
        <div style={{ padding: '12px 16px', borderBottom: '1px solid var(--line-1)', display: 'flex', alignItems: 'center', justifyContent: 'space-between' }}>
          <div style={{ display: 'flex', alignItems: 'center', gap: 8 }}>
            <Zap size={14} style={{ color: 'var(--accent)' }}/>
            <span style={{ fontSize: 13, fontWeight: 600, color: 'var(--fg-0)' }}>Verification Required</span>
          </div>
          <button onClick={onCancel} className="ico-btn"><X size={14}/></button>
        </div>
        <div style={{ padding: 20 }}>
          <p style={{ fontSize: 12, color: 'var(--fg-2)', marginBottom: 14, lineHeight: 1.6 }}>
            Enter the verification code to save it to your session context.
          </p>
          <span className="kv-label">Field: <span style={{ color: 'var(--accent)' }}>{otpPrompt.otpFieldName}</span></span>
          <input
            className="input"
            autoFocus
            placeholder="Enter code…"
            value={otpInput}
            onChange={e => setOtpInput(e.target.value)}
            onKeyDown={e => { if (e.key === 'Enter') onSubmit(); }}
            style={{ marginBottom: 12 }}
          />
          <div style={{ display: 'flex', gap: 8 }}>
            <button onClick={onSubmit} className="btn btn-primary" style={{ flex: 1 }}>Save & Continue</button>
            <button onClick={onCancel} className="btn">Cancel</button>
          </div>
        </div>
      </div>
    </div>
  );
}