I have a few different enums I want users to be able to select with Thaw. The way I'm currently doing that is marshalling back and forth from strings and this is leading to a significant amount of code. I'm considering whether I should create custom components for each enum type and/or create some generic solution. I'm curious if something like this already exists:
enum Status {
Open,
Closed
}
let status_mapping = [
(Status::Open, "Ouvert")
(Status::Closed, "Fermer")
];
let current_status = vec![Status::Open];
let selected_options;
view! {
<CustomSelect options=status_mapping value=current_status selected_options>
}
I want to keep display information on the client side and these enums are defined the back-end, so I'd rather not use a macro or traits for things that may need to be translated. Is there a good way to do this already or am I created a component that takes Model<T> and VecModel<T>
I have a few different enums I want users to be able to select with Thaw. The way I'm currently doing that is marshalling back and forth from strings and this is leading to a significant amount of code. I'm considering whether I should create custom components for each enum type and/or create some generic solution. I'm curious if something like this already exists:
I want to keep display information on the client side and these enums are defined the back-end, so I'd rather not use a macro or traits for things that may need to be translated. Is there a good way to do this already or am I created a component that takes
Model<T>andVecModel<T>