diff --git a/teressa-copeland-homes/src/app/portal/(protected)/layout.tsx b/teressa-copeland-homes/src/app/portal/(protected)/layout.tsx new file mode 100644 index 0000000..16c5f1d --- /dev/null +++ b/teressa-copeland-homes/src/app/portal/(protected)/layout.tsx @@ -0,0 +1,21 @@ +import { auth } from "@/lib/auth"; +import { redirect } from "next/navigation"; +import { PortalNav } from "../_components/PortalNav"; + +export default async function PortalLayout({ + children, +}: { + children: React.ReactNode; +}) { + const session = await auth(); + if (!session) { + redirect("/agent/login"); + } + + return ( +
+ +
{children}
+
+ ); +} diff --git a/teressa-copeland-homes/src/app/portal/_components/PortalNav.tsx b/teressa-copeland-homes/src/app/portal/_components/PortalNav.tsx new file mode 100644 index 0000000..149f523 --- /dev/null +++ b/teressa-copeland-homes/src/app/portal/_components/PortalNav.tsx @@ -0,0 +1,55 @@ +"use client"; + +import Link from "next/link"; +import { usePathname } from "next/navigation"; +import { LogoutButton } from "@/components/ui/LogoutButton"; + +interface PortalNavProps { + userEmail: string; +} + +const navLinks = [ + { href: "/portal/dashboard", label: "Dashboard" }, + { href: "/portal/clients", label: "Clients" }, +]; + +export function PortalNav({ userEmail }: PortalNavProps) { + const pathname = usePathname(); + + return ( + + ); +}