package de.thpeetz.kontor.media;

import com.vaadin.flow.component.icon.VaadinIcon;
import com.vaadin.flow.component.sidenav.SideNavItem;
import de.thpeetz.kontor.media.views.MediaActorView;
import de.thpeetz.kontor.media.views.MediaArticleView;
import de.thpeetz.kontor.media.views.MediaFileView;
import de.thpeetz.kontor.media.views.MediaVideoView;

import java.util.ArrayList;

public class MediaConstants {

    public static final String MEDIA = "Media";
    public static final String MEDIAFILE_ROUTE = "media/mediafile";
    public static final String MEDIAVIDEO_ROUTE = "media/mediavideo";
    public static final String MEDIAARTICLE_ROUTE = "media/mediaarticle";
    public static final String MEDIA_ROLE = "ROLE_MEDIA";
    public static final String MEDIAACTOR_ROUTE = "media/mediaactor";
    public static final String MEDIAACTORFILE_ROUTE = "media/mediaactorfile";
    public static final String MEDIAACTORFILE = "Media Actor Files";
    private static final String MEDIAFILE = "Media Files";
    private static final String MEDIAVIDEO = "Media Videos";
    private static final String MEDIAARTICLE = "Media Article";
    private static final String MEDIAACTOR = "Media Actor";

    public static SideNavItem getMediaNavigation(ArrayList<String> roles) {
        SideNavItem media = new SideNavItem(MEDIA, MEDIAFILE_ROUTE, VaadinIcon.VIMEO.create());
        media.addItem(new SideNavItem(MEDIAVIDEO, MediaVideoView.class));
        media.addItem(new SideNavItem(MEDIAARTICLE, MediaArticleView.class));
        if (roles.contains(MEDIA_ROLE)) {
            media.addItem(new SideNavItem(MEDIAFILE, MediaFileView.class));
            media.addItem(new SideNavItem(MEDIAACTOR, MediaActorView.class));
        }
        return media;
    }

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