"use client"; import React, { useState } from "react"; import { KeyRound, Lock } from "lucide-react"; import GlassButton from "./GlassButton"; import GlassInput from "./GlassInput"; import toast from "react-hot-toast"; interface GlassResetPasswordDialogProps { isOpen: boolean; onClose: () => void; onConfirm: (newPassword: string) => Promise; title: string; description: string; } export default function GlassResetPasswordDialog({ isOpen, onClose, onConfirm, title, description, }: GlassResetPasswordDialogProps): React.ReactElement | null { const [newPassword, setNewPassword] = useState(""); const [loading, setLoading] = useState(false); if (!isOpen) return null; const handleSubmit = async (e: React.FormEvent) => { e.preventDefault(); if (newPassword.length < 8) { toast.error("Password must be at least 8 characters"); return; } setLoading(true); try { await onConfirm(newPassword); setNewPassword(""); } finally { setLoading(false); } }; return (

{title}

{description}

setNewPassword(e.target.value)} icon={} autoComplete="new-password" />
{ setNewPassword(""); onClose(); }} disabled={loading} > Cancel Reset Password
); }