Full project added

This commit is contained in:
Marcelo Dares
2025-12-17 20:24:06 +00:00
parent fc2e4fd15a
commit 0e9b2dd72d
36 changed files with 2050 additions and 84 deletions

View File

@@ -0,0 +1,66 @@
"use client";
import Link from "next/link";
import { usePathname, useRouter } from "next/navigation";
const items = [
{ href: "/overview", label: "Overview", icon: "🏠" },
{ href: "/machines", label: "Machines", icon: "🏭" },
{ href: "/reports", label: "Reports", icon: "📊" },
{ href: "/settings", label: "Settings", icon: "⚙️" },
];
export function Sidebar() {
const pathname = usePathname();
const router = useRouter();
async function onLogout() {
await fetch("/api/logout", { method: "POST" });
router.push("/login");
router.refresh();
}
return (
<aside className="hidden md:flex h-screen w-64 flex-col border-r border-white/10 bg-black/40">
<div className="px-5 py-4">
<div className="text-white font-semibold tracking-wide">MIS</div>
<div className="text-xs text-zinc-500">Control Tower</div>
</div>
<nav className="px-3 py-2 flex-1 space-y-1">
{items.map((it) => {
const active = pathname === it.href || pathname.startsWith(it.href + "/");
return (
<Link
key={it.href}
href={it.href}
className={[
"flex items-center gap-3 rounded-xl px-3 py-2 text-sm transition",
active
? "bg-emerald-500/15 text-emerald-300 border border-emerald-500/20"
: "text-zinc-300 hover:bg-white/5 hover:text-white",
].join(" ")}
>
<span className="text-lg">{it.icon}</span>
<span>{it.label}</span>
</Link>
);
})}
</nav>
<div className="px-5 py-4 border-t border-white/10 space-y-3">
<div>
<div className="text-sm text-white">Juan Pérez</div>
<div className="text-xs text-zinc-500">Plant Manager</div>
</div>
<button
onClick={onLogout}
className="w-full rounded-xl border border-white/10 bg-white/5 px-3 py-2 text-sm text-zinc-200 hover:bg-white/10"
>
🚪 Logout
</button>
</div>
</aside>
);
}

View File

@@ -0,0 +1,12 @@
"use client";
export function Topbar({ title }: { title: string }) {
return (
<div className="h-16 flex items-center justify-between px-4 border-b border-white/10 bg-black/20 backdrop-blur">
<div className="text-lg font-semibold tracking-tight">{title}</div>
<div className="text-xs text-zinc-400">
Live (mock for now)
</div>
</div>
);
}