impulse_thaw/drawer/
drawer_header_title.rs

1use leptos::prelude::*;
2use thaw_components::OptionComp;
3use thaw_utils::class_list;
4
5#[component]
6pub fn DrawerHeaderTitle(
7    #[prop(optional, into)] class: MaybeProp<String>,
8    #[prop(optional)] drawer_header_title_action: Option<DrawerHeaderTitleAction>,
9    children: Children,
10) -> impl IntoView {
11    view! {
12        <div class=class_list!["thaw-drawer-header-title", class]>
13            <h2 class="thaw-drawer-header-title__heading">{children()}</h2>
14            <OptionComp value=drawer_header_title_action let:action>
15                <div class="thaw-drawer-header-title__action">{(action.children)()}</div>
16            </OptionComp>
17        </div>
18    }
19}
20
21#[slot]
22pub struct DrawerHeaderTitleAction {
23    children: Children,
24}