import React from 'react'; import { AlertIcon, PadlockIcon } from '../icon/index.js'; import { Button, Link } from '../index.js'; import { PassCode } from '../pass-code/pass-code.component.js'; import { PassCodeViewLoader } from './pass-code-view.loader.js'; import { styles as passCodeViewStyles } from './pass-code-view.styles.js'; import { type PassCodeViewProps } from './pass-code-view.types.js'; export function PassCodeView({ className, tag: Tag = 'div', headerIcon: HeaderIcon = PadlockIcon, header, description, updateButtonLabel = 'update', resendButtonLabel = 'Resend code', onUpdate = () => { return; }, onResend = () => { return; }, onComplete = () => { return; }, errorMessage, passCodeLength = 6, loading = false, ...props }: PassCodeViewProps) { const styles = passCodeViewStyles({}); return ( {HeaderIcon && } {header &&

{header}

} {loading ? ( ) : ( <> {description && (

{description} {updateButtonLabel}

)} {errorMessage && (

{errorMessage}

)} {resendButtonLabel && ( )} )}
); }