package hozza.network.views.backend;

import javax.annotation.security.PermitAll;

import com.vaadin.flow.component.button.Button;
import com.vaadin.flow.component.html.H1;
import com.vaadin.flow.component.orderedlayout.VerticalLayout;
import com.vaadin.flow.router.PageTitle;
import com.vaadin.flow.router.Route;

import hozza.network.security.auth.SecurityService;

@Route("/dashboard")
@PageTitle("Dashboard")
@PermitAll
public class Dashboard extends VerticalLayout
{
    private final SecurityService securityService;
    public Dashboard(SecurityService securityService)
    {
        this.securityService = securityService;
        this.addClassName("home");
        this.setSizeFull();
        this.setAlignItems(Alignment.CENTER);
        this.setJustifyContentMode(JustifyContentMode.CENTER);
        this.add(new H1("Welcome to website from backend"));
        this.add(new Button("Log out", e -> this.securityService.logout()));
    }
}
