summary refs log tree commit diff stats
path: root/src/components/banner.rs
blob: acaaf622736b16f96ad6cd35ecdc9f0d697a6c2f (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
use leptos::{
    IntoView, component,
    prelude::{ClassAttribute, ElementChild},
    view,
};

#[component]
pub fn Banner<T>(mut text: T) -> impl IntoView
where
    T: FnMut() -> String + Send + 'static,
{
    view! {
        <p class="text-white rounded-lg m-2 p-2 bg-red-600">
            {move || text()}
        </p>
    }
}