From 7bff22756beec82b4a1470e2d325b706dc56e5f2 Mon Sep 17 00:00:00 2001 From: Benedikt Peetz Date: Thu, 23 Oct 2025 01:36:39 +0200 Subject: feat(buy): Provide basic buy interface --- src/components/select_placeholder.rs | 40 +++++++++++++++++------------------- 1 file changed, 19 insertions(+), 21 deletions(-) (limited to 'src/components/select_placeholder.rs') diff --git a/src/components/select_placeholder.rs b/src/components/select_placeholder.rs index 947931c..2e0f783 100644 --- a/src/components/select_placeholder.rs +++ b/src/components/select_placeholder.rs @@ -1,37 +1,24 @@ use leptos::{ - IntoView, - attr::{AttributeValue, IntoAttributeValue}, - component, + IntoView, component, + error::Error, html::Select, prelude::{ ClassAttribute, CollectView, ElementChild, GlobalAttributes, NodeRef, NodeRefAttribute, }, + server::LocalResource, view, }; -use crate::components::get_id; +use crate::components::{async_fetch::AsyncFetch, get_id}; #[component] -pub fn SelectPlaceholder( +pub fn SelectPlaceholder( label: &'static str, node_ref: NodeRef - {options} + {move || AsyncFetch! { + @map_error_in_producer + from_resource = options + producer = |options| { + options + .into_iter() + .map(|(label, value)| { + view! { } + }) + .collect_view() + } + }} // TODO: Reference `var(--tw-border-2)` instead of the `2 px` <2025-10-01> -- cgit 1.4.1