Files
eu/app/account/update-button.tsx
2026-07-04 15:45:05 +03:00

14 lines
493 B
TypeScript

"use client";
import { useAction } from "@/hooks/useAction";
import { Button } from "@/components/ui/button";
import { Spinner } from "@/components/ui/spinner";
import { updateUserAction } from "@/lib/user/actions";
export function UpdateButton() {
const { run, isPending } = useAction(updateUserAction, { successMessage: "Profile updated" });
return (
<Button variant="secondary" disabled={isPending} onClick={() => run()}>
{isPending && <Spinner />}Update
</Button>
);
}