summary refs log tree commit diff stats
path: root/src/components/banner.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/components/banner.rs')
-rw-r--r--src/components/banner.rs17
1 files changed, 17 insertions, 0 deletions
diff --git a/src/components/banner.rs b/src/components/banner.rs
new file mode 100644
index 0000000..acaaf62
--- /dev/null
+++ b/src/components/banner.rs
@@ -0,0 +1,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>
+    }
+}