use gloo_net::http::Request;
use wasm_bindgen_futures::spawn_local;
use yew::prelude::*;
use yew_router::prelude::*;
#[macro_export]
/// Removes surrounding double quotes from a string.
///
/// This macro takes an expression that evaluates to a string and returns a new `String`
/// with any leading or trailing double quotes removed. It's useful for cleaning up
/// string data that might be inadvertently wrapped in quotes, such as JSON string values.
///
/// # Arguments
///
/// * `$str`: An expression that can be converted into a string slice (`&str`).
///
/// # Examples
///
/// ```rust
/// use your_crate::dequote; // Assuming `dequote` is re-exported or in scope
///
/// let quoted_string = "\"hello world\"";
/// let dequoted_string = dequote!(quoted_string);
/// assert_eq!(dequoted_string, "hello world");
///
/// let already_clean = "no quotes";
/// let dequoted_clean = dequote!(already_clean);
/// assert_eq!(dequoted_clean, "no quotes");
/// ```
macro_rules! dequote {
($str:expr) => {
$str.trim_matches('"').to_string()
};
}
/// The main home page component of the application.
///
/// This component displays different content based on whether the logged-in user
/// is an administrator. It fetches the user's admin status from the
/// `/api/users/current` endpoint upon initialization.
///
/// # Behavior
/// - **Loading**: Displays "Loading..." while fetching user data.
/// - **Admin User**: Renders the `TicketCount` utility component.
/// - **Non-Admin User**: Renders the `TicketCount` utility component.
///
/// # Example
/// ```rust
/// html! {
///
{ "You are logged in as: " }
{ &*name }
{ "The page you are looking for does not exist." }
to={crate::Route::Home}>{ "Back to Home" }>{ "Sie haben nicht die benötigten Rechte um diese Seite aufzurufen" }
{ "Wenn sie denken, dass dies ein Fehler ist kontaktieren sie Herrn Winter" }
to={crate::Route::Home}>{ "Back to Home" }>