//! Shared route component definitions
//!
//! This module re-exports route components from core_types
//! and provides compatibility and additional functionality.

// Re-export everything from core_types
pub use rustelo_core_types::{PageComponent, RouteComponent, RouteConfigToml, RoutesConfig};

#[cfg(test)]
mod tests {
    use std::str::FromStr;

    use super::*;

    #[test]
    fn test_route_component_from_str() {
        assert_eq!(
            RouteComponent::from_str("HomePage").unwrap(),
            RouteComponent::HomePage
        );
        assert_eq!(
            RouteComponent::from_str("NotFound").unwrap(),
            RouteComponent::NotFoundPage
        );
        assert_eq!(
            RouteComponent::from_str("Invalid").unwrap(),
            RouteComponent::DefaultPage // Default fallback
        );
    }

    #[test]
    fn test_route_component_as_str() {
        assert_eq!(RouteComponent::HomePage.as_str(), "HomePage");
        assert_eq!(RouteComponent::NotFoundPage.as_str(), "NotFoundPage");
    }

    #[test]
    fn test_route_component_title_key() {
        assert_eq!(RouteComponent::HomePage.title_key(), "page-home-title");
        assert_eq!(
            RouteComponent::NotFoundPage.title_key(),
            "page-notfound-title"
        );
    }

    #[test]
    fn test_route_component_description_key() {
        assert_eq!(
            RouteComponent::HomePage.description_key(),
            "page-home-description"
        );
        assert_eq!(
            RouteComponent::NotFoundPage.description_key(),
            "page-notfound-description"
        );
    }
}
