impulse_thaw/drawer/
drawer_body.rs

1use crate::Scrollbar;
2use leptos::{either::Either, prelude::*};
3use thaw_utils::class_list;
4
5#[component]
6pub fn DrawerBody(
7    #[prop(optional, into)] class: MaybeProp<String>,
8    /// Whether to use native scrollbar on itself.
9    #[prop(optional)]
10    native_scrollbar: bool,
11    children: Children,
12) -> impl IntoView {
13    view! {
14        <div class=class_list![
15            "thaw-drawer-body", class
16        ]>
17            {if native_scrollbar {
18                Either::Left(children())
19            } else {
20                Either::Right(view! { <Scrollbar>{children()}</Scrollbar> })
21            }}
22        </div>
23    }
24}