import React, { useEffect, useRef } from 'react'; import { InboxArrowDownIcon } from '@heroicons/react/20/solid'; import { Options } from '../../interfaces'; type Props = { registrationStep: string; registrationIsVisible: boolean; setRegistrationIsVisible: ( visible: boolean ) => void; onStep: ( requestedStep: string ) => void; registrationName: string; registrationEmail: string; setRegistrationName: ( name: string ) => void; setRegistrationEmail: ( email: string ) => void; pin: string; setPin: ( pin: string ) => void; options: Options; }; export const PinCheck: React.FC< Props > = ( { registrationStep, onStep, registrationEmail, pin, setPin, options, }: Props ) => { const inputRef = useRef< HTMLInputElement >( null ); // Force focus on the input when component mounts useEffect( () => { const timer = setTimeout( () => { if ( inputRef.current ) { inputRef.current.focus(); } }, 100 ); // Small delay to ensure DOM is ready return () => clearTimeout( timer ); }, [ registrationStep ] ); return (
); };