feat: add shared UI nav + fetch hook + table/select/label/textarea primitives
Basic infra for a functional (no-polish) UI pass over existing entity APIs.
This commit is contained in:
+14
-2
@@ -1,15 +1,27 @@
|
||||
import type { ReactNode } from "react";
|
||||
import "./globals.css";
|
||||
import { auth } from "@/auth";
|
||||
import { Nav } from "@/components/nav";
|
||||
|
||||
export const metadata = {
|
||||
title: "Asset & License Management",
|
||||
description: "Internal IT asset & license management — Ubisoft VN local IT",
|
||||
};
|
||||
|
||||
export default function RootLayout({ children }: { children: ReactNode }) {
|
||||
// Root layout wraps every route, including /login (middleware.ts can't
|
||||
// exclude it — it's the one page unauthenticated users must be able to
|
||||
// reach). Gate <Nav/> on session presence here rather than rendering it
|
||||
// unconditionally, so it only shows on authenticated pages as intended,
|
||||
// without needing a client-side pathname check.
|
||||
export default async function RootLayout({ children }: { children: ReactNode }) {
|
||||
const session = await auth();
|
||||
|
||||
return (
|
||||
<html lang="en">
|
||||
<body>{children}</body>
|
||||
<body>
|
||||
{session ? <Nav /> : null}
|
||||
{children}
|
||||
</body>
|
||||
</html>
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user