nova_forms/components/
nova_form_wrapper.rs1use leptos::*;
2
3use crate::AppContext;
4
5#[component]
8pub fn NovaFormWrapper(
9 #[prop(into)] logo: String,
11 #[prop(into)] title: TextProp,
13 #[prop(into)] subtitle: TextProp,
15 #[prop(into, optional)] footer: Option<Children>,
18 children: Children,
20) -> impl IntoView {
21 let base_context = expect_context::<AppContext>();
22
23 view! {
24 <header>
25 <div class="content">
26 <img id="logo" src=base_context.resolve_path(logo) />
27 <div id="name">
28 <span id="title">{title.clone()}</span>
29 <br />
30 <span id="subtitle">{subtitle}</span>
31 </div>
32 </div>
33 </header>
34 <main>
35 <div class="content">
36 {children()}
37 </div>
38 </main>
39 {
40 if let Some(footer) = footer {
41 view! {
42 <footer>
43 <div class="content">
44 <span>{footer()}</span>
45 </div>
46 </footer>
47 }.into_view()
48 } else {
49 View::default()
50 }
51 }
52
53 }
54}