import { Username } from '@standardnotes/snjs' import { ChallengePrompt } from '@standardnotes/services' import { RefObject, useState } from 'react' import { WebApplication } from '@/Application/WebApplication' import { isAndroid } from '@/Utils' import Button from '../Button/Button' import Icon from '../Icon/Icon' import { InputValue } from './InputValue' import U2FPromptIframeContainer from './U2FPromptIframeContainer' type Props = { application: WebApplication onValueChange: (value: InputValue['value'], prompt: ChallengePrompt) => void prompt: ChallengePrompt buttonRef: RefObject contextData?: Record } const U2FPrompt = ({ application, onValueChange, prompt, buttonRef, contextData }: Props) => { const [authenticatorResponse, setAuthenticatorResponse] = useState | null>(null) const [error, setError] = useState('') if (!application.isFullU2FClient && !isAndroid()) { return ( { onValueChange(response, prompt) }} /> ) } else { return (
{error &&
{error}
}
) } } export default U2FPrompt