.
This commit is contained in:
@@ -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>
|
||||
);
|
||||
}
|
||||
Reference in New Issue
Block a user