diff options
Diffstat (limited to 'src/components/buy.rs')
| -rw-r--r-- | src/components/buy.rs | 23 |
1 files changed, 15 insertions, 8 deletions
diff --git a/src/components/buy.rs b/src/components/buy.rs index 0c294ee..6d9402e 100644 --- a/src/components/buy.rs +++ b/src/components/buy.rs @@ -1,7 +1,9 @@ use leptos::{IntoView, component, view}; use log::info; +use rocie_client::models::UnitId; +use uuid::Uuid; -use crate::components::{form::Form, input_placeholder::InputPlaceholder, site_header::SiteHeader}; +use crate::components::{form::Form, site_header::SiteHeader}; #[component] pub fn Buy() -> impl IntoView { @@ -9,22 +11,27 @@ pub fn Buy() -> impl IntoView { <SiteHeader logo=icondata_io::IoPricetag back_location="/" name="Buy" /> {Form! { - on_submit = |Inputs {product_barcode, amount}| { - info!("Got product barcode: {product_barcode} with amount: {amount}"); - } + on_submit = |product_barcode, amount, unit_id| { + info!("Got product barcode: {product_barcode} with amount: {amount}, {unit_id}"); + }; <Input name=product_barcode, - signal_name_get=product_barcode_get, - signal_name_set=product_barcode_set, rust_type=u32, html_type="number", label="Product Barcode" /> + <Select + name=unit_id, + rust_type=Uuid, + label="Unit", + options=[ + ("Kilogram", Uuid::new_v4()), + ("Gram", Uuid::new_v4()) + ] + /> <Input name=amount, - signal_name_get=amount_get, - signal_name_set=amount_set, rust_type=u16, html_type="number", label="Amount" |
