package routing

import (
	t_ui "icdb/pkg/types/ui"
)

var currentView t_ui.UIView = t_ui.UIViewHome
var previousView t_ui.UIView

// Next changes the current view to the specified view.
// It sets the previous view to the current view before changing the view.
func Next(view t_ui.UIView) {
	previousView = currentView
	currentView = view
}

// Previous changes the current view to the previous view.
func Previous() {
	current := currentView
	currentView = previousView
	previousView = current
}

// Current returns the currently active view.
func Current() t_ui.UIView {
	return currentView
}
