from wagtail.snippets.models import register_snippet
from wagtail.snippets.views.snippets import SnippetViewSet, SnippetViewSetGroup

from sites_conformes.proconnect.models import WhitelistedEmailDomain


class WhitelistedEmailDomainViewSet(SnippetViewSet):
    model = WhitelistedEmailDomain
    icon = "mail"  # type: ignore
    admin_url_namespace = "member_views"


class ProconnectViewSetGroup(SnippetViewSetGroup):
    items = (WhitelistedEmailDomainViewSet,)
    menu_icon = "group"
    menu_label = "ProConnect"  # type: ignore
    menu_name = "proconnect"


register_snippet(ProconnectViewSetGroup)
