from django.urls import include, path, reverse
from django.utils.translation import gettext_lazy as _
from wagtail import hooks
from wagtail.admin.menu import MenuItem


@hooks.register("register_admin_urls")
def register_ai_assistant_admin_urls():
    return [
        path(
            "ai-assistant/",
            include(
                ("ocyan.plugin.ai_assistant.admin_urls", "ai_assistant_admin"),
                namespace="ai_assistant_admin",
            ),
        ),
    ]


@hooks.register("register_admin_menu_item")
def register_ai_assistant_menu_item():
    return MenuItem(
        _("AI Assistant"),
        reverse("ai_assistant_admin:dashboard"),
        icon_name="help",
        order=310,
    )
