magricambi/src/components/Navbar.tsx

67 lines
2.2 KiB
TypeScript
Raw Normal View History

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"
//====================================
"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";
import GlobalStabilimentoSelector from "./GlobalStabilimentoSelector";
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 }) {
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>
{/* 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}
className="text-sm text-zinc-300 hover:text-zinc-100 transition-colors"
2026-05-25 15:13:52 +02:00
>
{link.label}
</Link>
))}
</div>
2026-05-25 15:13:52 +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
{/* 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
}