/* openbills-web - Web client for Libre Billing Software * Copyright (C) 2023 Vidhu Kant Sharma * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ mod home; mod manage; use yew::prelude::*; use yew_router::prelude::*; use crate::components::navbar; #[derive(Clone, Routable, PartialEq)] pub enum Route { #[at("/")] Home, #[at("/manage")] ManageMenu, #[at("/manage/customers")] ManageCustomers, #[at("/manage/brands")] ManageBrands, #[at("/manage/items")] ManageItems, #[at("/manage/invoices")] ManageInvoices, #[at("/invoice/new")] NewInvoice, #[at("/invoice/all")] ViewInvoices, #[at("/invoice/one")] ViewInvoice, #[at("/settings")] Settings, #[at("/about")] About, #[not_found] #[at("/404")] NotFound, } pub fn switch(routes: Route) -> Html { match routes { Route::Home => html! {}, Route::ManageMenu => html! {}, Route::ManageCustomers => html! {}, Route::ManageBrands => html! {

{ "Edit Brands (To Be Added)" }

}, Route::ManageItems => html! {

{ "Edit Items (To Be Added)" }

}, Route::ManageInvoices => html! {

{ "Edit Invoices (To Be Added)" }

}, Route::NewInvoice => html! {

{ "Create New Invoice (To Be Added)" }

}, Route::ViewInvoices => html! {

{ "View All Invoices (To Be Added)" }

}, Route::ViewInvoice => html! {

{ "View a Single Invoice (To Be Added)" }

}, Route::Settings => html! {

{ "Settings Page (To Be Added)" }

}, Route::About => html! {

{ "About Page (To Be Added)" }

}, Route::NotFound => html! {

{"404 Page Not Found"}

}, } } #[function_component(App)] pub fn app() -> Html { html! {
render={switch} />
} }