mirror of
https://github.com/community-scripts/ProxmoxVE.git
synced 2025-09-13 07:10:51 +02:00
refactor: Enhance ScriptAccordion and Sidebar components to support selectedCategory state (#7405)
* refactor: Enhance ScriptAccordion and Sidebar components to support selectedCategory state * lint * chore: Add ESLint configuration to ignore errors during builds in next.config.mjs
This commit is contained in:
@@ -73,7 +73,13 @@ function CategoryView() {
|
||||
};
|
||||
|
||||
const handleScriptClick = (scriptSlug: string) => {
|
||||
router.push(`/scripts?id=${scriptSlug}`);
|
||||
// Include category context when navigating to scripts
|
||||
const categoryName = selectedCategoryIndex !== null ? categories[selectedCategoryIndex]?.name : null;
|
||||
const queryParams = new URLSearchParams({ id: scriptSlug });
|
||||
if (categoryName) {
|
||||
queryParams.append("category", categoryName);
|
||||
}
|
||||
router.push(`/scripts?${queryParams.toString()}`);
|
||||
};
|
||||
|
||||
const navigateCategory = (direction: "prev" | "next") => {
|
||||
|
||||
Reference in New Issue
Block a user