From 04572a8e5081b1e4871e273cde9dbaaa44c52fe0 Mon Sep 17 00:00:00 2001
From: MohamedBassem <me@mbassem.com>
Date: Wed, 13 Mar 2024 21:43:44 +0000
Subject: structure: Create apps dir and copy tooling dir from t3-turbo repo

---
 apps/web/components/signin/SignInForm.tsx | 37 +++++++++++++++++++++++++++++++
 1 file changed, 37 insertions(+)
 create mode 100644 apps/web/components/signin/SignInForm.tsx

(limited to 'apps/web/components/signin/SignInForm.tsx')

diff --git a/apps/web/components/signin/SignInForm.tsx b/apps/web/components/signin/SignInForm.tsx
new file mode 100644
index 00000000..7c8f8936
--- /dev/null
+++ b/apps/web/components/signin/SignInForm.tsx
@@ -0,0 +1,37 @@
+import { getProviders } from "next-auth/react";
+import SignInProviderButton from "./SignInProviderButton";
+import CredentialsForm from "./CredentialsForm";
+
+export default async function SignInForm() {
+  const providers = await getProviders();
+  let providerValues;
+  if (providers) {
+    providerValues = Object.values(providers).filter(
+      // Credentials are handled manually by the sign in form
+      (p) => p.id != "credentials",
+    );
+  }
+
+  return (
+    <div className="flex flex-col items-center space-y-2">
+      <CredentialsForm />
+
+      {providerValues && providerValues.length > 0 && (
+        <>
+          <div className="flex w-full items-center">
+            <div className="flex-1 grow border-t-2 border-gray-200"></div>
+            <span className="bg-white px-3 text-gray-500">Or</span>
+            <div className="flex-1 grow border-t-2 border-gray-200"></div>
+          </div>
+          <div className="space-y-2">
+            {providerValues.map((provider) => (
+              <div key={provider.id}>
+                <SignInProviderButton provider={provider} />
+              </div>
+            ))}
+          </div>
+        </>
+      )}
+    </div>
+  );
+}
-- 
cgit v1.2.3-70-g09d2

