feat: citizenship built

This commit is contained in:
Ivan Rezchikov
2026-07-03 15:03:35 +03:00
parent c60ab9e8f9
commit 2eb0de5357
46 changed files with 1150 additions and 257 deletions
+30
View File
@@ -0,0 +1,30 @@
"use client";
import { useTransition } from "react";
import { Button } from "@/components/ui/button";
import { Spinner } from "@/components/ui/spinner";
import { toast } from "sonner";
import { updateUserAction } from "@/lib/user/actions";
export function UpdateButton() {
const [isPending, startTransition] = useTransition();
return (
<Button
variant="secondary"
disabled={isPending}
onClick={() =>
startTransition(async () => {
try {
await updateUserAction();
toast.success("Profile updated");
} catch {
toast.error("Failed to update profile. Your session may have expired. Try signing in again.");
}
})
}
>
{isPending && <Spinner />}Update
</Button>
);
}