) => {
+ setError("");
+ setSuccess("");
+
+ // startTransition(() => {
+ // reset(values)
+ // .then((data) => {
+ // if (data.status === "error") {
+ // console.log("reset, error:", data.message);
+ // setError(data.message);
+ // }
+ // if (data.status === "success") {
+ // console.log("reset, success:", data.message);
+ // setSuccess(data.message);
+ // }
+ // })
+ // .catch((error) => {
+ // console.log("reset, error:", error);
+ // setError("Something went wrong");
+ // });
+ // });
+ };
+
+ return (
+
+
+
+
+ );
+};
diff --git a/src/components/auth/social-login-button.tsx b/src/components/auth/social-login-button.tsx
new file mode 100644
index 0000000..f0c89a8
--- /dev/null
+++ b/src/components/auth/social-login-button.tsx
@@ -0,0 +1,61 @@
+"use client";
+
+import { Icons } from "@/components/icons/icons";
+import { Button } from "@/components/ui/button";
+// import { DEFAULT_LOGIN_REDIRECT } from "@/routes";
+// import { signIn } from "next-auth/react";
+import { useSearchParams } from "next/navigation";
+import { useState } from "react";
+import { FaBrandsGitHub } from "../icons/github";
+import { FaBrandsGoogle } from "../icons/google";
+
+/**
+ * social login buttons
+ */
+export const SocialLoginButton = () => {
+ const searchParams = useSearchParams();
+ const callbackUrl = searchParams.get("callbackUrl");
+ const [isLoading, setIsLoading] = useState<"google" | "github" | null>(null);
+
+ const onClick = async (provider: "google" | "github") => {
+ setIsLoading(provider);
+ // signIn(provider, {
+ // callbackUrl: callbackUrl || DEFAULT_LOGIN_REDIRECT,
+ // });
+ // no need to reset the loading state, keep loading before webpage redirects
+ // setIsLoading(null);
+ };
+
+ return (
+
+
+
+
+ );
+};