/* eslint-disable @typescript-eslint/no-unused-vars */
export interface NavigationItem {
  href: string;
  text: string;
}

/**
 * Check if a navigation item is active based on current path
 */
export const isNavItemActive = (
  href: string,
  currentPath: string = "/",
): boolean => {
  // Handle Next.js App Router paths
  const cleanHref = href.replace(/^\//, "").replace(/\/$/, "");
  const cleanPath = currentPath.replace(/^\//, "").replace(/\/$/, "");

  return cleanHref === cleanPath || (cleanPath === "" && cleanHref === "");
};

/**
 * Get CSS class for navigation item based on active state
 */
export const getNavItemClass = (
  href: string,
  currentPath: string = "/",
): string => {
  const isActive = isNavItemActive(href, currentPath);
  return isActive ? "active" : "";
};

/**
 * Get current path from window location
 */
export const getCurrentPath = (): string => {
  if (typeof window !== "undefined") {
    return window.location.pathname;
  }
  return "";
};

/**
 * Check if a navigation item is active based on scroll position for one-page landing
 */
export const isNavItemActiveOnePage = (
  _href: string,
  _currentPath?: string,
): boolean => {
  // For one-page landing, we'll use react-scroll's built-in activeClass functionality
  // This function is kept for compatibility but the actual active state is handled by react-scroll
  return false;
};

/**
 * Get CSS class for navigation item based on active state for one-page landing
 */
export const getNavItemClassOnePage = (
  _href: string,
  _currentPath?: string,
): string => {
  // For one-page landing, react-scroll will handle the active class
  // This function is kept for compatibility but the actual active class is handled by react-scroll
  return "";
};
