"use client"; import { useState } from "react"; import { toast } from "sonner"; import { Button } from "@/components/ui/button"; import { signIn } from "@/lib/auth/auth-client"; export function GoogleButton({ callbackURL = "/dashboard" }: { callbackURL?: string }) { const [loading, setLoading] = useState(false); async function handleGoogle() { setLoading(true); const { error } = await signIn.social({ provider: "google", callbackURL }); if (error) { toast.error(error.message ?? "Google sign-in failed"); setLoading(false); } } return ( ); }