From 3a0e91bda1e93afa33dd182c2e820c94b3e94593 Mon Sep 17 00:00:00 2001 From: Benedikt Peetz Date: Sat, 25 Oct 2025 02:15:31 +0200 Subject: feat(treewide): Add further buttons The register product > associate barcode > buy barcode workflow is now usable. The only missing features for an MVP are unit and unit property creation. --- src/components/product_overview.rs | 25 +++++++------------------ 1 file changed, 7 insertions(+), 18 deletions(-) (limited to 'src/components/product_overview.rs') diff --git a/src/components/product_overview.rs b/src/components/product_overview.rs index 5413dc1..bf81624 100644 --- a/src/components/product_overview.rs +++ b/src/components/product_overview.rs @@ -1,7 +1,7 @@ use leptos::{IntoView, component, view}; use crate::{ - api::get_products, + api::products_registered_wrapped, components::{async_fetch::AsyncFetch, container::Container, icon_p::IconP}, }; @@ -9,31 +9,20 @@ use crate::{ pub fn ProductOverview() -> impl IntoView { view! { }, "inventory"), - (view! { }, "consume"), - (view! { }, "buy"), + (view! { }, "products"), + (view! { }, "create-product"), + (view! { }, "associate-barcode-product"), ] > { AsyncFetch! { @map_error_in_producer - fetcher = get_products(), + fetcher = products_registered_wrapped(), producer = |products| { - let products_num = products.len(); - let plural_s = if products_num == 1 { "" } else { "s" }; - let products_value = 2; - let products_currency = "EUR"; - view! { -

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

+

{format!("You have {} products", products.len())}

} } } -- cgit 1.4.1