//! Dynamic routing utilities for content paths

/// Get localized content path using the dynamic routing system
/// This replaces the hardcoded approach with configuration-driven routing
pub fn get_localized_content_path(content_type: &str, language: &str) -> String {
    let base_route = format!("/{}", content_type);
    rustelo_core_lib::routing::utils::get_localized_route(&base_route, language)
}

/// Generate back link for content using dynamic routing
pub fn generate_back_link(content_type: &str, language: &str) -> String {
    let localized_path = get_localized_content_path(content_type, language);

    // Get localized label for back link
    let back_label = match language {
        "es" => "← Volver",
        _ => "← Back",
    };

    format!(
        r#"<div class="back-link">
            <a href="{}">
                <span>{}</span>
            </a>
        </div>"#,
        localized_path, back_label
    )
}
