diff --git a/app/page.tsx b/app/page.tsx index e142cc2..6879306 100644 --- a/app/page.tsx +++ b/app/page.tsx @@ -1,41 +1,8 @@ -import { createServerComponentClient } from "@supabase/auth-helpers-nextjs"; -import { cookies } from "next/headers"; -import Link from "next/link"; -import { buttonVariants } from "@/components/ui/button"; -import LogoutButton from "@/components/logout"; - -export const dynamic = "force-dynamic"; - +import Navbar from "@/components/navbar"; export default async function Index() { - const supabase = createServerComponentClient({ cookies }); - - const { - data: { user }, - } = await supabase.auth.getUser(); - return (
diff --git a/components/navbar.tsx b/components/navbar.tsx new file mode 100644 index 0000000..94025c0 --- /dev/null +++ b/components/navbar.tsx @@ -0,0 +1,38 @@ +import Link from "next/link"; +import { buttonVariants } from "@/components/ui/button"; +import LogoutButton from "@/components/logout"; +import { createServerComponentClient } from "@supabase/auth-helpers-nextjs"; +import { cookies } from "next/headers"; + +export const dynamic = "force-dynamic"; + +export default async function Navbar() { + const supabase = createServerComponentClient({ cookies }); + + const { + data: { user }, + } = await supabase.auth.getUser(); + + return ( + + ); +}