import "@/styles/main.css"
import { setHeaderMenu } from "./ui";


type BootstrapOptions = {
  activeLink?: string | null;
  onReady?: () => void | Promise<void>;
};

export async function bootstrap(options: BootstrapOptions = {}): Promise<void> {
  const {
    activeLink = null,
    onReady,
  } = options;

  setHeaderMenu(null);

  if(activeLink !== null){setActiveLink(activeLink);}

  await onReady?.();
}

function setActiveLink(activeLink:string): void{
  const link = document.getElementById(activeLink);
  link?.classList.add('active');
}