This commit is contained in:
root
2025-12-14 10:39:18 +03:00
commit 639f4e2b4e
179 changed files with 21065 additions and 0 deletions

View File

@@ -0,0 +1,50 @@
use yew::prelude::*;
use yew_router::prelude::*;
use crate::pages::{CorpPage, LoginPage, NotFound, RegisterPage, ReplicantDetail, ReplicantsPage};
use crate::Layout;
use uuid::Uuid;
#[derive(Clone, Routable, PartialEq)]
pub enum Route {
#[at("/")]
Replicants,
#[at("/replicants/:id")]
ReplicantDetail { id: Uuid },
#[not_found]
#[at("/404")]
NotFound,
#[at("/login")]
Login,
#[at("/register")]
Register,
#[at("/corp")]
Corp,
}
pub fn switch(routes: Route) -> Html {
match routes {
Route::Login => html! { <LoginPage /> },
Route::Register => html! { <RegisterPage /> },
Route::Replicants => html! {
<Layout>
<ReplicantsPage />
</Layout>
},
Route::ReplicantDetail { id } => {
html! {
<Layout>
<ReplicantDetail replicant_id={id} />
</Layout>
}
}
Route::NotFound => html! {
<NotFound />
},
Route::Corp => html! {
<Layout>
<CorpPage />
</Layout>
},
}
}