package de.thpeetz.kontor.bookshelf;

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

import de.thpeetz.kontor.bookshelf.views.ArticleView;
import de.thpeetz.kontor.bookshelf.views.AuthorView;
import de.thpeetz.kontor.bookshelf.views.BookView;
import de.thpeetz.kontor.bookshelf.views.BookshelfPublisherView;

public class BookshelfConstants {

    public static final String AUTHOR = "Author";
    public static final String ARTICLE = "Article";
    public static final String BOOK = "Book";
    public static final String BOOKSHELF = "Bookshelf";
    public static final String PUBLISHER = "Publisher";
    public static final String PUBLISHER_ROUTE = "bookshelf/publisher";
    public static final String AUTHOR_ROUTE = "bookshelf/author";
    public static final String BOOK_ROUTE = "bookshelf/book";
    public static final String ARTICLE_ROUTE = "bookshelf/article";

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

    public static RouterLink getAuthorLink() {
        return new RouterLink(AUTHOR, AuthorView.class);
    }

    public static RouterLink getBookLink() {
        return new RouterLink(BOOK, BookView.class);
    }

    public static RouterLink getArticleLink() {
        return new RouterLink(ARTICLE, ArticleView.class);
    }

    public static SideNavItem getBookshelfNavigation() {
        SideNavItem bookshelf = new SideNavItem(BOOKSHELF, BookView.class, VaadinIcon.OPEN_BOOK.create());
        bookshelf.addItem(new SideNavItem(BOOK, BookView.class));
        bookshelf.addItem(new SideNavItem(PUBLISHER, BookshelfPublisherView.class));
        bookshelf.addItem(new SideNavItem(AUTHOR, AuthorView.class));
        bookshelf.addItem(new SideNavItem(ARTICLE, ArticleView.class));
        return bookshelf;
    }

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