Files
todo-baggins/src/components/project_select.rs
Matouš Volf dc3effe640
All checks were successful
actionlint check / actionlint check (pull_request) Successful in 6s
conventional pull request title check / conventional pull request title check (pull_request) Successful in 3s
conventional commit messages check / conventional commit messages check (pull_request) Successful in 7s
dotenv-linter check / dotenv-linter check (pull_request) Successful in 7s
GitLeaks check / GitLeaks check (pull_request) Successful in 10s
hadolint check / hadolint check (pull_request) Successful in 11s
htmlhint check / htmlhint check (pull_request) Successful in 44s
markdownlint check / markdownlint check (pull_request) Successful in 40s
Prettier check / Prettier check (pull_request) Successful in 36s
checkov check / checkov check (pull_request) Successful in 1m22s
ShellCheck check / ShellCheck check (pull_request) Successful in 29s
Stylelint check / Stylelint check (pull_request) Successful in 31s
yamllint check / yamllint check (pull_request) Successful in 29s
Rust check / Rust check (pull_request) Successful in 11m42s
fix: task sorting
2025-12-19 20:01:22 +01:00

31 lines
883 B
Rust

use crate::hooks::use_projects;
use dioxus::core_macro::{component, rsx};
use dioxus::dioxus_core::Element;
use dioxus::prelude::*;
use dioxus_i18n::t;
#[component]
pub(crate) fn ProjectSelect(initial_selected_id: Option<i32>) -> Element {
let projects = use_projects()?;
rsx! {
select {
name: "project_id",
class: "px-3.5 py-2.5 bg-zinc-800/50 rounded-lg grow cursor-pointer",
id: "input_project",
option {
value: 0,
{t!("none")}
},
for project in projects {
option {
value: project.id.to_string(),
initial_selected: initial_selected_id.is_some_and(
|id| id == project.id
),
{project.title}
}
}
}
}
}