feat(ui): add dashboard sections with sidebar navigation and mock views
Add seven sidebar sections (Dashboard, Providers, Chat, Tools, Knowledge Base, Developer, Organization) with fully rendered mock views, nested sub-shells for Developer and Organization, and SearXNG container for future news feed integration. Replaces the previous OverviewPage with a news feed dashboard. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
44
src/components/sub_nav.rs
Normal file
44
src/components/sub_nav.rs
Normal file
@@ -0,0 +1,44 @@
|
||||
use crate::app::Route;
|
||||
use dioxus::prelude::*;
|
||||
|
||||
/// A single tab item for the sub-navigation bar.
|
||||
///
|
||||
/// # Fields
|
||||
///
|
||||
/// * `label` - Display text for the tab
|
||||
/// * `route` - Route to navigate to when clicked
|
||||
#[derive(Clone, PartialEq)]
|
||||
pub struct SubNavItem {
|
||||
pub label: &'static str,
|
||||
pub route: Route,
|
||||
}
|
||||
|
||||
/// Horizontal tab navigation bar used inside nested shell layouts.
|
||||
///
|
||||
/// Highlights the active tab based on the current route.
|
||||
///
|
||||
/// # Arguments
|
||||
///
|
||||
/// * `items` - List of tab items to render
|
||||
#[component]
|
||||
pub fn SubNav(items: Vec<SubNavItem>) -> Element {
|
||||
let current_route = use_route::<Route>();
|
||||
|
||||
rsx! {
|
||||
nav { class: "sub-nav",
|
||||
for item in &items {
|
||||
{
|
||||
let is_active = item.route == current_route;
|
||||
let class = if is_active { "sub-nav-item sub-nav-item--active" } else { "sub-nav-item" };
|
||||
rsx! {
|
||||
Link {
|
||||
class: "{class}",
|
||||
to: item.route.clone(),
|
||||
"{item.label}"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user