pub mod platform;
pub use platform::Platform;
pub mod models;
#[derive(Debug, Clone)]
pub struct NavItemConfig {
pub id: String,
pub label: String,
pub icon: String,
}
#[derive(Debug, Clone)]
pub struct ToolbarItemConfig {
pub id: String,
pub icon: String,
pub tooltip: String,
}
#[derive(Debug, Default)]
pub struct ShellConfig {
pub platform: Platform,
pub title: String,
pub nav: Vec<NavItemConfig>,
pub toolbar: Vec<ToolbarItemConfig>,
pub show_toolbar: bool,
}
impl ShellConfig {
pub fn new(platform: Platform, title: impl Into<String>) -> Self {
Self {
platform,
title: title.into(),
..Default::default()
}
}
pub fn with_nav(mut self, items: Vec<NavItemConfig>) -> Self {
self.nav = items;
self
}
pub fn with_toolbar(mut self, items: Vec<ToolbarItemConfig>) -> Self {
self.show_toolbar = !items.is_empty();
self.toolbar = items;
self
}
}