import { jsx as _jsx } from "react/jsx-runtime";
import Link from "next/link";
import { cn } from "../../../utils/cn";
export const Navigation = ({ items = [], orientation = "horizontal", className, }) => {
    const list = Array.isArray(items) ? items : [];
    return (_jsx("nav", { className: cn("flex", orientation === "horizontal" ? "flex-row" : "flex-col", "gap-2", className), role: "navigation", "aria-label": "Main navigation", children: list.map((item, index) => {
            const isActive = item.active;
            const content = (_jsx("span", { className: cn("px-4 py-2 rounded-lg transition-colors", isActive
                    ? "bg-primary-100 dark:bg-primary-900/30 text-primary-700 dark:text-primary-300"
                    : "text-neutral-700 dark:text-neutral-300 hover:bg-neutral-100 dark:hover:bg-neutral-800"), children: item.label }));
            if (item.href) {
                return (_jsx(Link, { href: item.href, "aria-current": isActive ? "page" : undefined, children: content }, index));
            }
            if (item.onClick) {
                return (_jsx("button", { onClick: item.onClick, "aria-current": isActive ? "page" : undefined, className: "text-left", children: content }, index));
            }
            return _jsx("div", { children: content }, index);
        }) }));
};
export default Navigation;
