All checks were successful
actionlint check / actionlint check (pull_request) Successful in 7s
conventional pull request title check / conventional pull request title check (pull_request) Successful in 3s
GitLeaks check / GitLeaks check (pull_request) Successful in 14s
hadolint check / hadolint check (pull_request) Successful in 15s
conventional commit messages check / conventional commit messages check (pull_request) Successful in 7s
dotenv-linter check / dotenv-linter check (pull_request) Successful in 8s
htmlhint check / htmlhint check (pull_request) Successful in 20s
markdownlint check / markdownlint check (pull_request) Successful in 32s
Prettier check / Prettier check (pull_request) Successful in 33s
checkov check / checkov check (pull_request) Successful in 1m20s
ShellCheck check / ShellCheck check (pull_request) Successful in 30s
Stylelint check / Stylelint check (pull_request) Successful in 27s
yamllint check / yamllint check (pull_request) Successful in 26s
Rust check / Rust check (pull_request) Successful in 12m52s
34 lines
1.1 KiB
Rust
34 lines
1.1 KiB
Rust
use crate::components::task_list::TaskList;
|
|
use crate::models::category::Category;
|
|
use crate::query::QueryValue;
|
|
use crate::query::tasks::use_tasks_with_subtasks_in_category_query;
|
|
use dioxus::core_macro::rsx;
|
|
use dioxus::dioxus_core::Element;
|
|
use dioxus::prelude::*;
|
|
use dioxus_query::prelude::QueryResult;
|
|
|
|
#[component]
|
|
pub(crate) fn CategoryPage(category: Category) -> Element {
|
|
let tasks_query = use_tasks_with_subtasks_in_category_query(category);
|
|
let tasks_query_result = tasks_query.result();
|
|
|
|
match tasks_query_result.value() {
|
|
QueryResult::Ok(QueryValue::TasksWithSubtasks(tasks))
|
|
| QueryResult::Loading(Some(QueryValue::TasksWithSubtasks(tasks))) => rsx! {
|
|
TaskList {
|
|
tasks: tasks.clone(),
|
|
class: "pb-36"
|
|
}
|
|
},
|
|
QueryResult::Loading(None) => rsx! {
|
|
// TODO: Add a loading indicator.
|
|
},
|
|
QueryResult::Err(errors) => rsx! {
|
|
div {
|
|
"Errors occurred: {errors:?}"
|
|
}
|
|
},
|
|
value => panic!("Unexpected query result: {value:?}"),
|
|
}
|
|
}
|