package de.assecutor.votianlt.pages.view;

import com.vaadin.flow.component.html.H1;
import com.vaadin.flow.component.html.Main;
import com.vaadin.flow.component.html.Paragraph;
import com.vaadin.flow.component.orderedlayout.VerticalLayout;
import com.vaadin.flow.router.Menu;
import com.vaadin.flow.router.HasDynamicTitle;
import com.vaadin.flow.router.Route;
import com.vaadin.flow.theme.lumo.LumoUtility;
import de.assecutor.votianlt.pages.base.ui.component.ViewToolbar;

import jakarta.annotation.security.RolesAllowed;

@Route(value = "verwaltung", layout = de.assecutor.votianlt.pages.base.ui.view.MainLayout.class)
@Menu(order = 5, icon = "vaadin:cogs", title = "Verwaltung")
@RolesAllowed("USER")
public class VerwaltungView extends Main implements HasDynamicTitle {

    public VerwaltungView() {
        setSizeFull();
        addClassNames(LumoUtility.BoxSizing.BORDER, LumoUtility.Display.FLEX, LumoUtility.FlexDirection.COLUMN,
                LumoUtility.Padding.MEDIUM, LumoUtility.Gap.SMALL);
        addClassName("data-view");

        add(new ViewToolbar(getTranslation("verwaltung.title")));

        // Content
        VerticalLayout content = new VerticalLayout();

        H1 title = new H1(getTranslation("verwaltung.title"));
        title.getStyle().set("color", "var(--lumo-primary-color)");

        Paragraph description = new Paragraph(getTranslation("verwaltung.description"));
        description.getStyle().set("color", "var(--lumo-secondary-text-color)");

        content.add(title, description);
        content.setDefaultHorizontalComponentAlignment(VerticalLayout.Alignment.CENTER);
        content.setJustifyContentMode(VerticalLayout.JustifyContentMode.CENTER);
        content.setSizeFull();
        content.addClassNames("surface-panel", "section-panel");

        add(content);
    }

    @Override
    public String getPageTitle() {
        return getTranslation("page.title.verwaltung");
    }
}
