1
mirror of https://github.com/jakejarvis/jarv.is.git synced 2026-06-05 20:15:31 -04:00

homebrew comments system

This commit is contained in:
2025-05-14 09:47:51 -04:00
parent cce48e558f
commit b196249f25
61 changed files with 3616 additions and 397 deletions
+35
View File
@@ -0,0 +1,35 @@
"use client";
import { env } from "@/lib/env";
import { useState } from "react";
import { Loader2Icon } from "lucide-react";
import Button from "@/components/ui/button";
import { GitHubIcon } from "@/components/icons";
import { signIn } from "@/lib/auth-client";
const SignIn = ({ callbackPath }: { callbackPath?: string }) => {
const [isLoading, setIsLoading] = useState(false);
const handleSignIn = async () => {
setIsLoading(true);
try {
await signIn.social({
provider: "github",
callbackURL: `${env.NEXT_PUBLIC_BASE_URL}${callbackPath ? callbackPath : "/"}`,
});
} catch (error) {
console.error("Error signing in:", error);
setIsLoading(false);
}
};
return (
<Button onClick={handleSignIn} disabled={isLoading} size="lg" variant="outline">
{isLoading ? <Loader2Icon className="animate-spin" /> : <GitHubIcon />}
Sign in with GitHub
</Button>
);
};
export default SignIn;