// rocie - An enterprise grocery management system - Web app // // Copyright (C) 2026 Benedikt Peetz // SPDX-License-Identifier: GPL-3.0-or-later // // This file is part of Rocie. // // You should have received a copy of the License along with this program. // If not, see . use leptos::{IntoView, component, view}; use crate::{ api::products_in_storage_wrapped, components::{async_fetch::AsyncFetch, container::Container, icon_p::IconP}, }; #[component] pub fn Inventory() -> impl IntoView { view! { }, "inventory"), (view! { }, "consume"), (view! { }, "buy"), ] > { AsyncFetch! { @map_error_in_producer fetcher = products_in_storage_wrapped(), producer = |products| { let products_num = products.len(); let plural_s = if products_num == 1 { "" } else { "s" }; let products_value = -1; let products_currency = "TODO"; view! {

{format!( "You have {products_num} product{plural_s} \ in stock with a value \ of {products_value} {products_currency}.", )}

} } } }
} }