stage 1
This commit is contained in:
@@ -0,0 +1,31 @@
|
||||
import Link from "next/link";
|
||||
import { requireAdmin } from "@/lib/auth";
|
||||
import LogoutButton from "@/components/LogoutButton";
|
||||
|
||||
export default async function AdminLayout({ children }: { children: React.ReactNode }) {
|
||||
const user = await requireAdmin();
|
||||
|
||||
return (
|
||||
<div className="min-h-dvh flex flex-col">
|
||||
<header className="border-b border-slate-200 bg-white">
|
||||
<div className="mx-auto max-w-7xl px-4 py-3 flex items-center gap-6">
|
||||
<Link href="/admin" className="font-semibold tracking-tight">
|
||||
MRP <span className="text-slate-400 font-normal">· Admin</span>
|
||||
</Link>
|
||||
<nav className="flex gap-4 text-sm text-slate-600">
|
||||
<Link href="/admin" className="hover:text-slate-900">Dashboard</Link>
|
||||
<Link href="/admin/projects" className="hover:text-slate-900">Projects</Link>
|
||||
<Link href="/admin/machines" className="hover:text-slate-900">Machines</Link>
|
||||
<Link href="/admin/operations" className="hover:text-slate-900">Operation templates</Link>
|
||||
<Link href="/admin/users" className="hover:text-slate-900">Users</Link>
|
||||
</nav>
|
||||
<div className="ml-auto flex items-center gap-3 text-sm">
|
||||
<span className="text-slate-500">{user.name}</span>
|
||||
<LogoutButton />
|
||||
</div>
|
||||
</div>
|
||||
</header>
|
||||
<main className="flex-1">{children}</main>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
@@ -0,0 +1,27 @@
|
||||
export default function AdminDashboardPage() {
|
||||
return (
|
||||
<div className="mx-auto max-w-7xl px-4 py-8">
|
||||
<h1 className="text-2xl font-semibold">Dashboard</h1>
|
||||
<p className="text-slate-500 mt-1">
|
||||
Project planning, machines, operations, and users will appear here as each area is built.
|
||||
</p>
|
||||
<div className="mt-8 grid gap-4 sm:grid-cols-2 lg:grid-cols-3">
|
||||
<Card title="Projects" desc="Plan work: assemblies, parts, and operations." />
|
||||
<Card title="Machines" desc="Manage shop-floor equipment." />
|
||||
<Card title="Operation templates" desc="Reusable step recipes." />
|
||||
<Card title="Fasteners & POs" desc="Aggregate BOM, generate purchase orders." />
|
||||
<Card title="Users" desc="Admins and operator PIN accounts." />
|
||||
<Card title="Audit log" desc="Who did what, when." />
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
function Card({ title, desc }: { title: string; desc: string }) {
|
||||
return (
|
||||
<div className="rounded-xl bg-white border border-slate-200 p-5">
|
||||
<h2 className="font-medium">{title}</h2>
|
||||
<p className="text-sm text-slate-500 mt-1">{desc}</p>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
Reference in New Issue
Block a user