use parking_lot::Mutex;
use re_viewer_context::{ContainerId, ViewerContext};
use crate::ViewportBlueprint;
mod add_view_or_container_modal;
use add_view_or_container_modal::AddViewOrContainerModal;
static ADD_VIEW_OR_CONTAINER_MODAL: once_cell::sync::Lazy<Mutex<AddViewOrContainerModal>> =
once_cell::sync::Lazy::new(|| Mutex::new(AddViewOrContainerModal::default()));
pub fn add_view_or_container_modal_ui(
ctx: &ViewerContext<'_>,
viewport: &ViewportBlueprint,
ui: &egui::Ui,
) {
ADD_VIEW_OR_CONTAINER_MODAL
.lock()
.ui(ui.ctx(), ctx, viewport);
}
pub fn show_add_view_or_container_modal(target_container: ContainerId) {
ADD_VIEW_OR_CONTAINER_MODAL.lock().open(target_container);
}