import { useState } from 'react'; import Modal from 'antd/es/modal'; import { useNavigate, useLocation } from 'react-router-dom'; import AuthForm, { AuthMode } from './AuthForm'; type Props = Readonly<{ open: boolean; onClose: () => void; onSuccess: () => void; }>; // The prompt shown when a signed-out visitor does something that needs an // account — adding to the cart, favoriting, or filtering by favorites. It is // only the framing: the form itself is shared with the /login and /register // routes, so the two cannot drift apart in validation, copy, or consent // wording again. export default function AuthPromptModal({ open, onClose, onSuccess }: Props) { const [mode, setMode] = useState('register'); const navigate = useNavigate(); const location = useLocation(); return ( { onClose(); navigate('/forgot-password', { state: { background: location } }); }} onSuccess={onSuccess} /> ); }