mirror of
https://github.com/community-scripts/ProxmoxVED.git
synced 2026-02-24 13:44:34 +00:00
only show categorys wich have scripts in it
This commit is contained in:
@@ -12,7 +12,9 @@ const Sidebar = ({
|
|||||||
selectedScript: string | null;
|
selectedScript: string | null;
|
||||||
setSelectedScript: (script: string | null) => void;
|
setSelectedScript: (script: string | null) => void;
|
||||||
}) => {
|
}) => {
|
||||||
const uniqueScripts = items.reduce((acc, category) => {
|
const filteredItems = items.filter(category => category.scripts && category.scripts.length > 0);
|
||||||
|
|
||||||
|
const uniqueScripts = filteredItems.reduce((acc, category) => {
|
||||||
for (const script of category.scripts) {
|
for (const script of category.scripts) {
|
||||||
if (!acc.some((s) => s.name === script.name)) {
|
if (!acc.some((s) => s.name === script.name)) {
|
||||||
acc.push(script);
|
acc.push(script);
|
||||||
@@ -31,7 +33,7 @@ const Sidebar = ({
|
|||||||
</div>
|
</div>
|
||||||
<div className="rounded-lg">
|
<div className="rounded-lg">
|
||||||
<ScriptAccordion
|
<ScriptAccordion
|
||||||
items={items}
|
items={filteredItems}
|
||||||
selectedScript={selectedScript}
|
selectedScript={selectedScript}
|
||||||
setSelectedScript={setSelectedScript}
|
setSelectedScript={setSelectedScript}
|
||||||
/>
|
/>
|
||||||
|
|||||||
Reference in New Issue
Block a user