This commit is contained in:
Debian
2026-03-30 14:24:39 +00:00
parent dec232212d
commit 87198824b6
15 changed files with 178 additions and 216 deletions
@@ -0,0 +1,59 @@
type ResetLinkModalProps = {
email: string;
resetLink: string;
expiresAt: string;
onClose: () => void;
};
export default function ResetLinkModal({
email,
resetLink,
expiresAt,
onClose
}: ResetLinkModalProps) {
const handleCopy = async () => {
try {
await navigator.clipboard.writeText(resetLink);
} catch {
// The field stays visible even if clipboard access is unavailable.
}
};
return (
<div className="modal-backdrop" role="presentation">
<div className="modal-card" role="dialog" aria-modal="true">
<div className="modal-header">
<div>
<h2>Temporary reset link</h2>
<p>
No email was sent for <strong>{email}</strong>. Share this one-time link yourself.
</p>
</div>
<button type="button" className="ghost-button" onClick={onClose}>
Close
</button>
</div>
<div className="stack">
<label className="field">
<span>One-time link</span>
<input type="text" readOnly value={resetLink} />
</label>
<p className="modal-copy">
This link expires at {expiresAt} and becomes invalid after first use.
</p>
<div className="modal-actions">
<button type="button" className="ghost-button" onClick={onClose}>
Done
</button>
<button type="button" className="primary-button" onClick={handleCopy}>
Copy link
</button>
</div>
</div>
</div>
</div>
);
}