tallyweb_components/
loading_screen.rs

1#![allow(non_snake_case)]
2use super::*;
3use leptos::*;
4
5#[component]
6pub fn LoadingMessage() -> impl IntoView {
7    view! {
8        <div style="display: flex; align-items: center;">
9            <Spinner />
10            <b style="font-size: 20px; padding-left: 24px;">Loading</b>
11        </div>
12    }
13}
14
15#[component]
16pub fn LoadingScreen(#[prop(optional)] accent_color: Option<Signal<String>>) -> impl IntoView {
17    let border_style = move || {
18        format!(
19            "2px solid {}",
20            accent_color
21                .map(|ac| ac())
22                .unwrap_or(String::from("#ffe135"))
23        )
24    };
25
26    view! {
27        <div class="notification-box" style:border=border_style>
28            <LoadingMessage />
29        </div>
30    }
31}