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 5s
dotenv-linter check / dotenv-linter check (pull_request) Successful in 12s
GitLeaks check / GitLeaks check (pull_request) Successful in 11s
hadolint check / hadolint check (pull_request) Successful in 28s
markdownlint check / markdownlint check (pull_request) Successful in 52s
Prettier check / Prettier check (pull_request) Successful in 36s
htmlhint check / htmlhint check (pull_request) Successful in 55s
checkov check / checkov check (pull_request) Successful in 1m15s
Stylelint check / Stylelint check (pull_request) Successful in 31s
yamllint check / yamllint check (pull_request) Successful in 29s
ShellCheck check / ShellCheck check (pull_request) Successful in 1m9s
Rust check / Rust check (pull_request) Successful in 22m2s
31 lines
1019 B
Rust
31 lines
1019 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-4 pt-3 pb-2.25 bg-gray-800-muted enabled:hover:bg-gray-800 enabled:active:bg-gray-800 drop-shadow-[0_calc(0px_-_var(--spacing))_0_var(--color-gray-900-muted)] rounded-xl grow cursor-pointer",
|
|
id: "input_project_id",
|
|
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}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|