"use client"; import { useState } from "react"; import { OneTimeCredentials } from "@/components/OneTimeCredentials"; import { resetMemberPassword, type IssuedCredentials } from "../actions"; export function ResetPasswordButton({ memberId }: { memberId: number }) { const [issued, setIssued] = useState(null); const [pending, setPending] = useState(false); return (
{issued && }
{ setPending(true); try { const result = await resetMemberPassword(fd); setIssued(result ?? null); } finally { setPending(false); } }} >
); }