como/crates/como_web/src/routes/features_view.rs
kjuulh 71b5a63700
Some checks failed
continuous-integration/drone/push Build is failing
feat: with como_web
Signed-off-by: kjuulh <contact@kjuulh.io>
2023-10-21 11:23:11 +02:00

44 lines
1.3 KiB
Rust

use leptos::*;
use uuid::Uuid;
use crate::features::navbar_projects::gen::queries::get_projects_list_view::GetProjectsListViewGetProjects;
use crate::features::navbar_projects::NavbarProjectsView;
#[component]
pub fn FeaturesView() -> impl IntoView {
let projects = create_local_resource(
|| (),
|_| async {
vec![
GetProjectsListViewGetProjects {
id: Uuid::new_v4(),
name: "some-name".to_string(),
},
GetProjectsListViewGetProjects {
id: Uuid::new_v4(),
name: "some-other-name".to_string(),
},
]
},
);
let emptyProjects: Resource<(), Vec<GetProjectsListViewGetProjects>> =
create_local_resource(|| (), |_| async { Vec::new() });
view! {
<div>
<div class="space-y-5 p-2">
<h1>"NavbarProjects"</h1>
<h2>"Projects"</h2>
<div class="feature-case">
<NavbarProjectsView projects=projects/>
</div>
<h2>"no projects"</h2>
<div class="feature-case">
<NavbarProjectsView projects=emptyProjects/>
</div>
</div>
</div>
}
}