diff --git a/frontend/src/app/category-view/page.tsx b/frontend/src/app/category-view/page.tsx index 3f5736d3..00e75832 100644 --- a/frontend/src/app/category-view/page.tsx +++ b/frontend/src/app/category-view/page.tsx @@ -10,20 +10,19 @@ const CategoryView = () => { const [selectedCategory, setSelectedCategory] = useState(null); useEffect(() => { - const fetchCategories = async () => { - try { - const basePath = process.env.NODE_ENV === "production" ? "/ProxmoxVE" : ""; // Passe den Basis-Pfad an - const response = await fetch(`${basePath}/api/categories`); - if (!response.ok) { - throw new Error("Failed to fetch categories"); - } - const data = await response.json(); - console.log("Fetched categories:", data); // Debugging - setCategories(data); - } catch (error) { - console.error("Error fetching categories:", error); - } - }; + const fetchCategories = async () => { + try { + const response = await fetch("/api/categories"); + if (!response.ok) { + throw new Error("Failed to fetch categories"); + } + const data = await response.json(); + console.log("Fetched categories:", data); // Debugging + setCategories(data); + } catch (error) { + console.error("Error fetching categories:", error); + } + }; fetchCategories(); }, []); @@ -70,9 +69,24 @@ const CategoryView = () => { handleCategoryClick(category)} - className="cursor-pointer hover:shadow-lg" + className="cursor-pointer hover:shadow-lg flex flex-col items-center justify-center" > - + +
+ {category.scripts && category.scripts.slice(0, 4).map((script, index) => ( + {script.name} + ))} +
+

{category.name}

+ {category.description && ( +

{category.description}

+ )} +
))}