from rich.console import Console
import os
from pathlib import Path
from tui import menu_toolchain, menu_bootloader, menu_kernel # pylint: disable=wrong-import-position, import-error

console = Console()

def run():
    while True:
        console.clear()
        console.rule("[bold yellow]Compilar NFDOS[/bold yellow]")
        console.print("1. Compilar/Gerir o Kernel")
        console.print("2. Compilar/Gerir o Bootloader")
        console.print("3. Compilar/Gerir a Toolchain")
        console.print("0. Voltar")

        choice = console.input("\n[cyan]nfdos> [/cyan]")

        if choice == "1":
            menu_kernel.run()
        elif choice == "2":
            menu_bootloader.run()
        elif choice == "3":
            menu_toolchain.run()
        elif choice == "0":
            break
        else:
            console.print("[red]Opção inválida![/red]")
