only show categorys wich have scripts in it
This commit is contained in:
parent
ad0607361a
commit
3f3d967a2c
@ -12,7 +12,9 @@ const Sidebar = ({
|
||||
selectedScript: string | null;
|
||||
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) {
|
||||
if (!acc.some((s) => s.name === script.name)) {
|
||||
acc.push(script);
|
||||
@ -31,7 +33,7 @@ const Sidebar = ({
|
||||
</div>
|
||||
<div className="rounded-lg">
|
||||
<ScriptAccordion
|
||||
items={items}
|
||||
items={filteredItems}
|
||||
selectedScript={selectedScript}
|
||||
setSelectedScript={setSelectedScript}
|
||||
/>
|
||||
|
Loading…
x
Reference in New Issue
Block a user