//! Safe HTML content component that handles hydration properly
//!
//! This component safely renders HTML content from FTL files without
//! causing hydration mismatches between SSR and client.

use leptos::prelude::*;

/// Component that safely renders HTML content with line breaks
///
/// Uses `inner_html` for consistent SSR/client rendering to avoid hydration
/// issues.
#[component]
pub fn HtmlContent(
    /// The HTML content to render
    content: String,
    /// Additional CSS classes
    #[prop(default = String::new())]
    class: String,
) -> impl IntoView {
    // Use inner_html for hydration safety - this ensures the same HTML
    // is rendered on both server and client without dynamic generation
    view! {
        <div class={class} inner_html={content}></div>
    }
}
