package de.thpeetz.kontor.admin;

import com.vaadin.flow.component.icon.VaadinIcon;
import com.vaadin.flow.component.sidenav.SideNavItem;
import com.vaadin.flow.router.RouterLink;
import de.thpeetz.kontor.admin.views.AssignmentView;
import de.thpeetz.kontor.admin.views.PermissionView;
import de.thpeetz.kontor.admin.views.ProfileView;
import de.thpeetz.kontor.comics.ComicConstants;
import de.thpeetz.kontor.comics.views.ComicWorkView;
import de.thpeetz.kontor.comics.views.IssueWorkView;
import de.thpeetz.kontor.media.MediaConstants;
import de.thpeetz.kontor.media.views.MediaActorFileView;

public class AdminConstants {

    private AdminConstants() {
        // private constructor to hide the implicit public one
    }

    public static final String ADMIN_TITLE = "Verwaltung";
    public static final String AUTHORIZATION = "Berechtigungen";
    public static final String ASSIGNMENT_ROUTE = "/admin/assignment";
    public static final String DATA = "Daten";
    public static final String METADATA_ROUTE = "admin/metadata";
    public static final String PERMISSION = "Berechtigungen";
    public static final String PERMISSION_ROUTE = "/admin/permission";
    public static final String PROFILE = "Benutzer";
    public static final String PROFILE_ROUTE = "/admin/profile";
    public static final String ADMIN = "admin";
    public static final String ADMIN_ROUTE = "/admin";

    public static RouterLink getProfileNavigation() {
        return new RouterLink(PROFILE, ProfileView.class);
    }

    public static RouterLink getPermissionNavigation() {
        return new RouterLink(PERMISSION, PermissionView.class);
    }

    public static RouterLink getAuthorizationNavigation() {
        return new RouterLink(AUTHORIZATION, AssignmentView.class);
    }

    public static SideNavItem getAdminNavigation() {
        SideNavItem administration = new SideNavItem(ADMIN_TITLE, PROFILE_ROUTE, VaadinIcon.GROUP.create());
        administration.addItem(new SideNavItem(PROFILE, PROFILE_ROUTE, VaadinIcon.USERS.create()));
        administration.addItem(new SideNavItem(PERMISSION, PermissionView.class));
        SideNavItem data = new SideNavItem(DATA, ASSIGNMENT_ROUTE, VaadinIcon.DATABASE.create());
        data.addItem(new SideNavItem(ComicConstants.COMICWORK, ComicWorkView.class));
        data.addItem(new SideNavItem(ComicConstants.ISSUEWORK, IssueWorkView.class));
        data.addItem(new SideNavItem(MediaConstants.MEDIAACTORFILE, MediaActorFileView.class));
        data.addItem(new SideNavItem(AUTHORIZATION, AssignmentView.class));
        administration.addItem(data);
        return administration;
    }
}
