2025-04-14 13:27:06 +00:00
|
|
|
"use client";
|
|
|
|
|
|
|
|
import { useRouter, useSearchParams } from "next/navigation";
|
2025-03-18 14:14:12 +00:00
|
|
|
import { GithubSignInForm } from "@/components/github-sign-in-form";
|
|
|
|
import { CredentialsSignInForm } from "@/components/credentials-sign-in-form";
|
2025-03-14 06:36:35 +00:00
|
|
|
|
|
|
|
export function SignInForm() {
|
2025-04-14 13:27:06 +00:00
|
|
|
const router = useRouter();
|
|
|
|
const searchParams = useSearchParams();
|
|
|
|
|
|
|
|
const handleSignUp = () => {
|
|
|
|
const params = new URLSearchParams(searchParams.toString());
|
|
|
|
router.push(`/sign-up?${params.toString()}`);
|
|
|
|
};
|
|
|
|
|
2025-03-14 06:36:35 +00:00
|
|
|
return (
|
|
|
|
<div className="flex flex-col gap-6">
|
|
|
|
<div className="flex flex-col items-center gap-2 text-center">
|
|
|
|
<h1 className="text-2xl font-bold">Sign in to your account</h1>
|
|
|
|
<p className="text-balance text-sm text-muted-foreground">
|
|
|
|
Enter your email below to sign in to your account
|
|
|
|
</p>
|
|
|
|
</div>
|
2025-03-18 14:14:12 +00:00
|
|
|
<CredentialsSignInForm />
|
2025-03-14 06:36:35 +00:00
|
|
|
<div className="relative text-center text-sm after:absolute after:inset-0 after:top-1/2 after:z-0 after:flex after:items-center after:border-t after:border-border">
|
|
|
|
<span className="relative z-10 bg-background px-2 text-muted-foreground">
|
|
|
|
Or
|
|
|
|
</span>
|
|
|
|
</div>
|
2025-03-18 14:14:12 +00:00
|
|
|
<GithubSignInForm />
|
2025-03-14 06:36:35 +00:00
|
|
|
<div className="text-center text-sm">
|
|
|
|
Don't have an account?{" "}
|
2025-04-14 13:27:06 +00:00
|
|
|
<button
|
|
|
|
onClick={handleSignUp}
|
|
|
|
className="underline underline-offset-4"
|
|
|
|
>
|
2025-03-14 06:36:35 +00:00
|
|
|
Sign up
|
2025-04-14 13:27:06 +00:00
|
|
|
</button>
|
2025-03-14 06:36:35 +00:00
|
|
|
</div>
|
|
|
|
</div>
|
2025-03-18 14:14:12 +00:00
|
|
|
);
|
2025-03-14 06:36:35 +00:00
|
|
|
}
|