From 250e77cff741fdb7b5b35373ac0958b04a0a759f Mon Sep 17 00:00:00 2001 From: CanbiZ <47820557+MickLesk@users.noreply.github.com> Date: Thu, 23 Jan 2025 11:40:58 +0100 Subject: [PATCH] formatting --- frontend/src/app/category-view/page.tsx | 28 ++++++++++++++----------- 1 file changed, 16 insertions(+), 12 deletions(-) diff --git a/frontend/src/app/category-view/page.tsx b/frontend/src/app/category-view/page.tsx index c1ad9aa8..336fa6c5 100644 --- a/frontend/src/app/category-view/page.tsx +++ b/frontend/src/app/category-view/page.tsx @@ -15,7 +15,7 @@ const CategoryView = () => { const fetchCategories = async () => { try { const basePath = process.env.NODE_ENV === "production" ? "/ProxmoxVE" : ""; - const response = await fetch(`${basePath}/api/categories`); // Prüfe den Endpunkt + const response = await fetch(`${basePath}/api/categories`); if (!response.ok) { throw new Error("Failed to fetch categories"); } @@ -39,19 +39,18 @@ const CategoryView = () => { }; return ( -
- No categories available. Please check the API endpoint. -
- ) : selectedCategory ? ( +No categories available. Please check the API endpoint.
+ )} + {selectedCategory ? (+ {categories.reduce((acc, cat) => acc + (cat.scripts?.length || 0), 0)} Total scripts +
+- {(category as any).description || "No description available."} + {category.description || "No description available."}