// File: ui/TrainingFormUI.java
package ui;

import javafx.geometry.Insets;
import javafx.scene.control.Tab;
import javafx.scene.control.TabPane;
import javafx.scene.layout.BorderPane;

public class TrainingFormUI extends BorderPane {

    private final TrainingFormUIEnterEvent enterTab = new TrainingFormUIEnterEvent();
    private final TrainingFormUIPlanner plannerTab = new TrainingFormUIPlanner();

    public TrainingFormUI() {
        setPadding(new Insets(15));

        TabPane tabs = new TabPane();
        tabs.setTabClosingPolicy(TabPane.TabClosingPolicy.UNAVAILABLE);

        Tab tabEnter = new Tab("Neue Schulung anlegen", enterTab);
        Tab tabPlan  = new Tab("Schulungen vorausplanen", plannerTab);

        tabs.getTabs().addAll(tabEnter, tabPlan);
        setCenter(tabs);
    }

    /** Delegiert DB-abhängige Reloads an die Tabs */
    public void refreshTrainingTypes() {
        enterTab.refreshTrainingTypes();
        plannerTab.refreshTrainingTypes(); // derzeit No-Op
    }
}
