package de.thpeetz.kontor.comics;

import com.vaadin.flow.component.Component;
import com.vaadin.flow.component.icon.VaadinIcon;
import com.vaadin.flow.component.sidenav.SideNavItem;
import com.vaadin.flow.router.RouterLink;

import de.thpeetz.kontor.comics.views.ArtistView;
import de.thpeetz.kontor.comics.views.ComicView;
import de.thpeetz.kontor.comics.views.ComicWorkView;
import de.thpeetz.kontor.comics.views.IssueView;
import de.thpeetz.kontor.comics.views.IssueWorkView;
import de.thpeetz.kontor.comics.views.PublisherView;
import de.thpeetz.kontor.comics.views.StoryArcView;
import de.thpeetz.kontor.comics.views.TradePaperbackView;
import de.thpeetz.kontor.comics.views.VolumeView;
import de.thpeetz.kontor.comics.views.WorktypeView;

/**
 * The {@code ComicConstants} class contains constant values related to comics.
 */
public class ComicConstants {

    public static final String COMICS = "Comics";
    public static final String COMICS_ROUTE = "comics/comic";
    public static final String PUBLISHER = "Publisher";
    public static final String PUBLISHER_ROUTE = "comics/publisher";
    public static final String COMICWORK = "ComicWork";
    public static final String ISSUEWORK = "IssueWork";
    public static final String COMICWORK_ROUTE = "comics/comicwork";
    public static final String ISSUEWORK_ROUTE = "comics/issuework";
    public static final String WORKTYPE = "Worktype";
    public static final String WORKTYPE_ROUTE = "comics/worktype";
    public static final String ARTIST = "Artist";
    public static final String ARTIST_ROUTE = "comics/artist";
    public static final String TPB = "TradePaperback";
    public static final String TPB_ROUTE = "comics/tradepaperback";
    public static final String STORYARC = "Story Arc";
    public static final String STORYARC_ROTE = "comics/storyarc";
    public static final String ISSUE = "Issue";
    public static final String ISSUE_ROUTE = "comics/issue";
    public static final String VOLUME = "Volume";
    public static final String VOLUME_ROUTE = "comics/volume";

    public static RouterLink getArtistLink() {
        return new RouterLink(ARTIST, ArtistView.class);
    }

    public static RouterLink getComicLink() {
        return new RouterLink(COMICS, ComicView.class);
    }

    public static RouterLink getPublisherLink() {
        return new RouterLink(PUBLISHER, PublisherView.class);
    }

    public static RouterLink getComicWorkLink() {
        return new RouterLink(COMICWORK, ComicWorkView.class);
    }

    public static RouterLink getIssueWorkLink() {
        return new RouterLink(ISSUEWORK, IssueWorkView.class);
    }

    public static RouterLink getIssueLink() {
        return new RouterLink(ISSUE, IssueView.class);
    }

    public static RouterLink getTradePaperbackLink() {
        return new RouterLink(TPB, TradePaperbackView.class);
    }

    public static Component getStoryArcLink() {
        return new RouterLink(STORYARC, StoryArcView.class);
    }

    public static RouterLink getWorktypeLink() {
        return new RouterLink(WORKTYPE, WorktypeView.class);
    }

    public static RouterLink getVolumeLink() {
        return new RouterLink(VOLUME, VolumeView.class);
    }

    public static SideNavItem getComicsNavigation() {
        SideNavItem comics = new SideNavItem(COMICS, COMICS_ROUTE, VaadinIcon.RECORDS.create());
        comics.addItem(new SideNavItem(ARTIST, ArtistView.class));
        comics.addItem(new SideNavItem(COMICS, ComicView.class));
        comics.addItem(new SideNavItem(PUBLISHER, PublisherView.class));
        comics.addItem(new SideNavItem(ISSUE, IssueView.class));
        comics.addItem(new SideNavItem(TPB, TradePaperbackView.class));
        comics.addItem(new SideNavItem(STORYARC, StoryArcView.class));
        comics.addItem(new SideNavItem(VOLUME, VolumeView.class));
        comics.addItem(new SideNavItem(WORKTYPE, WorktypeView.class));
        return comics;
    }

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