2026-05-25 09:48:11 +02:00
|
|
|
//====================================
|
|
|
|
|
// File: Navbar.tsx
|
|
|
|
|
// componente Navbar
|
|
|
|
|
// @author: "villari.andrea@libero.it"
|
|
|
|
|
// @version: "1.0.0 2026-05-07"
|
|
|
|
|
//====================================
|
2026-05-25 13:12:30 +02:00
|
|
|
"use client"
|
2026-05-27 16:10:53 +02:00
|
|
|
import { useState , MouseEvent, ReactNode} from "react";
|
2026-05-25 15:13:52 +02:00
|
|
|
import Link from "next/link";
|
2026-05-29 16:08:27 +02:00
|
|
|
import GlobalStabilimentoSelector from "./GlobalStabilimentoSelector";
|
2026-05-25 13:12:30 +02:00
|
|
|
|
2026-05-25 15:13:52 +02:00
|
|
|
interface NavLink {
|
|
|
|
|
href: string;
|
|
|
|
|
label: string;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
const navLinks: NavLink[] = [
|
|
|
|
|
{ href: "/", label: "Home"},
|
|
|
|
|
{ href: "/movimenti", label: "Movimenti"},
|
|
|
|
|
{ href: "/articoli", label: "Articoli"},
|
|
|
|
|
{ href: "/macchine", label: "Macchine"},
|
|
|
|
|
{ href: "/utenti", label: "Utenti"},
|
|
|
|
|
];
|
|
|
|
|
|
2026-05-27 16:10:53 +02:00
|
|
|
export default function Navbar({ actions }: { actions?: ReactNode }) {
|
2026-05-29 16:08:27 +02:00
|
|
|
return (
|
|
|
|
|
<nav className="border-b border-zinc-800 bg-black">
|
|
|
|
|
<div className="max-w-7xl mx-auto px-4">
|
|
|
|
|
<div className="flex items-center justify-between h-14">
|
2026-05-25 15:13:52 +02:00
|
|
|
{/* Logo */}
|
|
|
|
|
<Link
|
|
|
|
|
href="/"
|
|
|
|
|
className="flex items-center font-bold text-zinc-100 hover:text-zinc-300 transition-colors"
|
|
|
|
|
>
|
|
|
|
|
LOGO
|
|
|
|
|
</Link>
|
|
|
|
|
|
2026-05-29 16:08:27 +02:00
|
|
|
{/* Navigation Links */}
|
|
|
|
|
<div className="flex items-center space-x-6">
|
2026-05-25 15:13:52 +02:00
|
|
|
{navLinks.map((link) => (
|
|
|
|
|
<Link
|
|
|
|
|
key={link.href}
|
|
|
|
|
href={link.href}
|
2026-05-29 16:08:27 +02:00
|
|
|
className="text-sm text-zinc-300 hover:text-zinc-100 transition-colors"
|
2026-05-25 15:13:52 +02:00
|
|
|
>
|
|
|
|
|
{link.label}
|
|
|
|
|
</Link>
|
|
|
|
|
))}
|
2026-05-29 16:08:27 +02:00
|
|
|
</div>
|
2026-05-25 15:13:52 +02:00
|
|
|
|
2026-05-29 16:08:27 +02:00
|
|
|
{/* Stabilimento Selector */}
|
|
|
|
|
<div className="flex-1 flex justify-center px-4">
|
|
|
|
|
<GlobalStabilimentoSelector />
|
2026-05-25 15:13:52 +02:00
|
|
|
</div>
|
2026-05-27 16:10:53 +02:00
|
|
|
|
2026-05-29 16:08:27 +02:00
|
|
|
{/* Actions */}
|
2026-05-27 16:10:53 +02:00
|
|
|
{actions ? (
|
|
|
|
|
<div className="flex items-center">
|
|
|
|
|
{actions}
|
|
|
|
|
</div>
|
|
|
|
|
) : null}
|
2026-05-25 15:13:52 +02:00
|
|
|
</div>
|
2026-05-25 09:48:11 +02:00
|
|
|
</div>
|
2026-05-25 15:13:52 +02:00
|
|
|
</nav>
|
|
|
|
|
);
|
2026-05-27 16:10:53 +02:00
|
|
|
}
|