use leptos::prelude::*;

use super::{GraphMini, OntologyContext, RelatedContent};

/// Knowledge graph footer for project showcase pages.
///
/// Renders the ego-network mini graph, related content list, and ontology
/// context badges in a horizontal section at the bottom of project pages.
/// Renders nothing if the project has no graph connections.
#[component]
pub fn ProjectGraphSection(node_id: String) -> impl IntoView {
    view! {
        <section class="ds-container py-8 mt-4 border-t ds-border">
            <div class="flex flex-col md:flex-row gap-6 items-start">
                <GraphMini node_id=node_id.clone() class="shrink-0".to_string() />
                <div class="flex flex-col gap-4 flex-1 min-w-0">
                    <RelatedContent node_id=node_id.clone() />
                    <OntologyContext node_id=node_id />
                </div>
            </div>
        </section>
    }
}
