use leptos::prelude::*;
use orbital_theme::{baseline_asset_path, baseline_primary_font_preload_path, ROOT_THEME_SCOPE_ID};
const BASELINE_CSS: &str = include_str!(env!("ORBITAL_THEME_BASELINE_CSS"));
#[component]
pub fn OrbitalFirstPaintHeadAssets(
#[prop(optional, into)]
base_path: Option<String>,
) -> impl IntoView {
let base = base_path.unwrap_or_else(|| super::shell_site_base().to_string());
let stylesheet_href = baseline_asset_path(&base);
let font_preload_href = baseline_primary_font_preload_path(&base);
let scope_id = ROOT_THEME_SCOPE_ID;
view! {
<style data-orbital-theme-baseline=scope_id>
{BASELINE_CSS}
</style>
<link
rel="stylesheet"
href=stylesheet_href.clone()
data-orbital-theme-baseline=scope_id
/>
<link rel="preload" href=stylesheet_href r#as="style" />
<link rel="preload" href=font_preload_href r#as="font" crossorigin="anonymous" />
}
}