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:
toanhoang
2026-08-03 06:36:16 -04:00
parent 6b39c01f4e
commit 0576d6e61c
7 changed files with 508 additions and 2 deletions
+14 -2
View File
@@ -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>
);
}