import { useState, useCallback } from 'react' import Copy from 'lucide-react/dist/esm/icons/copy' import Check from 'lucide-react/dist/esm/icons/check' import { Button } from '@/components/ui/button' import { Input } from '@/components/ui/input' import { Dialog, DialogContent, DialogHeader, DialogTitle, DialogDescription, DialogFooter, DialogClose, } from '@/components/ui/dialog' export default function ResetLinkDialog({ resetLink, onClose, onCopy }) { const [copied, setCopied] = useState(false) const handleCopy = useCallback(async () => { await onCopy() setCopied(true) setTimeout(() => setCopied(false), 2000) }, [onCopy]) return ( { if (!open) { setCopied(false); onClose() } }}> Password Reset Link {resetLink?.full_name} · {resetLink?.email}
{resetLink?.is_local_url && (

⚠ This link uses localhost and won't work for other users. Run the backend with a production FRONTEND_URL to generate shareable links.

)}

Expires {resetLink && new Date(resetLink.expires_at).toLocaleString('en-IN', { day: '2-digit', month: 'short', year: 'numeric', hour: '2-digit', minute: '2-digit', })}

) }