Frontend
This commit is contained in:
@@ -46,10 +46,10 @@ export default function ScriptAccordion({
|
||||
);
|
||||
if (category) {
|
||||
setExpandedItem(category.name);
|
||||
handleSelected(selectedScript);
|
||||
}
|
||||
}
|
||||
}, [selectedScript, items, handleSelected]);
|
||||
}, [selectedScript, items]);
|
||||
|
||||
return (
|
||||
<Accordion
|
||||
type="single"
|
||||
|
||||
@@ -21,6 +21,8 @@ const Sidebar = ({
|
||||
return acc;
|
||||
}, [] as Script[]);
|
||||
|
||||
const filteredItems = items.filter(category => category.scripts.length > 0);
|
||||
|
||||
return (
|
||||
<div className="flex min-w-72 flex-col sm:max-w-72">
|
||||
<div className="flex items-end justify-between pb-4">
|
||||
@@ -31,7 +33,7 @@ const Sidebar = ({
|
||||
</div>
|
||||
<div className="rounded-lg">
|
||||
<ScriptAccordion
|
||||
items={items}
|
||||
items={filteredItems}
|
||||
selectedScript={selectedScript}
|
||||
setSelectedScript={setSelectedScript}
|
||||
/>
|
||||
@@ -40,4 +42,4 @@ const Sidebar = ({
|
||||
);
|
||||
};
|
||||
|
||||
export default Sidebar;
|
||||
export default Sidebar;
|
||||
|
||||
Reference in New Issue
Block a user