All checks were successful
actionlint check / actionlint check (pull_request) Successful in 5s
conventional commit messages check / conventional commit messages check (pull_request) Successful in 7s
conventional pull request title check / conventional pull request title check (pull_request) Successful in 5s
dotenv-linter check / dotenv-linter check (pull_request) Successful in 10s
hadolint check / hadolint check (pull_request) Successful in 16s
GitLeaks check / GitLeaks check (pull_request) Successful in 10s
htmlhint check / htmlhint check (pull_request) Successful in 35s
Prettier check / Prettier check (pull_request) Successful in 26s
markdownlint check / markdownlint check (pull_request) Successful in 31s
checkov check / checkov check (pull_request) Successful in 1m15s
ShellCheck check / ShellCheck check (pull_request) Successful in 30s
Stylelint check / Stylelint check (pull_request) Successful in 29s
yamllint check / yamllint check (pull_request) Successful in 27s
Rust check / Rust check (pull_request) Successful in 11m44s
28 lines
877 B
Rust
28 lines
877 B
Rust
use crate::{hooks::use_projects, models::project::Project};
|
|
use dioxus::prelude::*;
|
|
|
|
#[component]
|
|
pub(crate) fn ProjectList() -> Element {
|
|
let projects = use_projects()?();
|
|
let mut project_being_edited = use_context::<Signal<Option<Project>>>();
|
|
|
|
rsx! {
|
|
div {
|
|
class: "flex flex-col",
|
|
for project in projects {
|
|
div {
|
|
key: "{project.id}",
|
|
class: format!(
|
|
"px-8 py-4 select-none {}",
|
|
if project_being_edited().is_some_and(|p| p.id == project.id) {
|
|
"bg-zinc-700"
|
|
} else { "" }
|
|
),
|
|
onclick: move |_| project_being_edited.set(Some(project.clone())),
|
|
{project.title.clone()}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|