import type { AuthUser } from "@/shared/auth";
import { getVisibleItems } from "./menuTypes";
import { createIcons, House, MapPin, Award, Shield, BookOpen, LogIn, Menu } from 'lucide';

export function setHeaderMenu(user: AuthUser | null): void {
  const nav = document.getElementById('header-menu');
  if (!nav) {
    console.error('Header target element not found');
    return;
  }
  const items = getVisibleItems(false);
  console.log(user);
  items.forEach(link =>{
    const a = document.createElement('a');
    a.id = link.id;
    a.href = link.href
    a.classList.add('h-14', 'w-10');
    a.innerHTML = `<i data-lucide="${link.ico}"></i><span>${link.label || ''}</span>`;
    nav.appendChild(a);
  })
  createIcons({ icons: { House, MapPin, Award, Shield, BookOpen, LogIn, Menu }});
}