diff --git a/app/(components-navbar)/auth-status.tsx b/app/(components-navbar)/auth-status.tsx index 598b8c3..b787195 100644 --- a/app/(components-navbar)/auth-status.tsx +++ b/app/(components-navbar)/auth-status.tsx @@ -25,5 +25,5 @@ export default async function AuthStatus() { return; } - return ; + return ; } diff --git a/app/(components-navbar)/user-nav.tsx b/app/(components-navbar)/user-nav.tsx index 789087a..fed1ef4 100644 --- a/app/(components-navbar)/user-nav.tsx +++ b/app/(components-navbar)/user-nav.tsx @@ -12,16 +12,18 @@ import { DropdownMenuTrigger, } from "@/components/ui/dropdown-menu"; import { type Database } from "@/lib/schema"; -import { createClientComponentClient } from "@supabase/auth-helpers-nextjs"; -import { LogOut, Settings, User } from "lucide-react"; +import { createClientComponentClient, type Session } from "@supabase/auth-helpers-nextjs"; +import { LogOut, User } from "lucide-react"; import Link from "next/link"; import { useRouter } from "next/navigation"; type Profile = Database["public"]["Tables"]["profiles"]["Row"]; -export default function UserNav({ profile }: { profile: Profile }) { +export default function UserNav({ profile, session }: { profile: Profile; session: Session }) { // Create Supabase client (for client components) const supabaseClient = createClientComponentClient(); + // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment + const userType = session.user.user_metadata.type; // all user metadata is defined as an any type. const router = useRouter(); @@ -51,15 +53,15 @@ export default function UserNav({ profile }: { profile: Profile }) { {/* Using Next Link: https://github.com/radix-ui/primitives/issues/1105 */} - + - Profile + {userType === "clinician" ? "Create clinic" : "Join clinic"} - - - Settings + + + Profile