All checks were successful
conventional pull request title check / conventional pull request title check (pull_request) Successful in 5s
conventional commit messages check / conventional commit messages check (pull_request) Successful in 7s
actionlint check / actionlint check (pull_request) Successful in 6s
dotenv-linter check / dotenv-linter check (pull_request) Successful in 9s
GitLeaks check / GitLeaks check (pull_request) Successful in 16s
hadolint check / hadolint check (pull_request) Successful in 20s
htmlhint check / htmlhint check (pull_request) Successful in 1m10s
markdownlint check / markdownlint check (pull_request) Successful in 1m4s
Prettier check / Prettier check (pull_request) Successful in 58s
checkov check / checkov check (pull_request) Successful in 1m58s
ShellCheck check / ShellCheck check (pull_request) Successful in 34s
Stylelint check / Stylelint check (pull_request) Successful in 32s
yamllint check / yamllint check (pull_request) Successful in 29s
Rust check / Rust check (pull_request) Successful in 27m44s
26 lines
880 B
Rust
26 lines
880 B
Rust
use crate::route::Route;
|
|
use crate::{components::project_form::PROJECT_BEING_EDITED, hooks::use_projects};
|
|
use dioxus::prelude::*;
|
|
|
|
#[component]
|
|
pub(crate) fn ProjectList() -> Element {
|
|
let navigator = use_navigator();
|
|
let projects = use_projects()?;
|
|
rsx! {
|
|
div {
|
|
class: "flex flex-col",
|
|
for project in projects {
|
|
div {
|
|
class: "px-7 sm:px-8 py-4 hover:bg-gray-800 font-medium text-pretty wrap-anywhere select-none transition-all duration-150 cursor-pointer",
|
|
key: "{project.id}",
|
|
onclick: move |_| {
|
|
*PROJECT_BEING_EDITED.write() = Some(project.clone());
|
|
navigator.push(Route::ProjectFormPage);
|
|
},
|
|
{project.title.clone()}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|