package de.thpeetz.kontor.tysc.views;

import com.vaadin.flow.component.applayout.AppLayout;
import com.vaadin.flow.component.orderedlayout.HorizontalLayout;
import com.vaadin.flow.theme.lumo.LumoUtility;

import de.thpeetz.kontor.admin.services.AdminService;
import de.thpeetz.kontor.common.views.KontorLayoutUtil;
import de.thpeetz.kontor.security.SecurityService;
import de.thpeetz.kontor.tysc.TyscConstants;
import lombok.extern.slf4j.Slf4j;

/**
 * Represents a custom layout for the comic view in the application.
 * This layout extends the AppLayout class.
 */
@Slf4j
public class TyscLayout extends AppLayout {

    private final AdminService adminService;

    private final SecurityService securityService;

    public TyscLayout(AdminService adminService, SecurityService securityService) {
        this.adminService = adminService;
        this.securityService = securityService;

        KontorLayoutUtil layout = new KontorLayoutUtil(this, adminService, securityService);
        layout.setSecondaryNavigation(getSecondaryNavigation());
        layout.createHeader(TyscConstants.TYSC);
    }

    private HorizontalLayout getSecondaryNavigation() {
        HorizontalLayout navigation = new HorizontalLayout();
        navigation.addClassNames(LumoUtility.JustifyContent.CENTER, LumoUtility.Gap.SMALL, LumoUtility.Height.MEDIUM);
        navigation.add(TyscConstants.getSportLink(), TyscConstants.getTeamLink(), TyscConstants.getPositionLink(),
                TyscConstants.getPlayerLink(), TyscConstants.getRoosterLink(), TyscConstants.getVendorLink(),
                TyscConstants.getCardSetLink(), TyscConstants.getCardLink());
        return navigation;
    }
}
