mirror of
https://github.com/community-scripts/ProxmoxVE.git
synced 2025-07-01 19:47:38 +00:00
* Update ScriptAccordion and ScriptItem components for improved styling * Add README.md for Proxmox VE Helper-Scripts Frontend * Remove testing dependencies and related test files from the frontend project * Update analytics URL in siteConfig to point to community-scripts.org * Refactor ESLint configuration to have one source of truth and run "npm lint" to apply new changes * Update lint script in package.json to remove npm * Add 'next' option to ESLint configuration for improved compatibility * Update package dependencies and versions in package.json and package-lock.json * Refactor theme provider import and enhance calendar component for dynamic icon rendering * rename sidebar, alerts and buttons * rename description and interfaces files * rename more files * change folder name * Refactor tooltip logic to improve updateable condition handling * Enhance CommandMenu to prevent duplicate scripts across categories * Remove test step from frontend CI/CD workflow
47 lines
1.1 KiB
TypeScript
47 lines
1.1 KiB
TypeScript
"use client";
|
|
|
|
import type { Category, Script } from "@/lib/types";
|
|
|
|
import ScriptAccordion from "./script-accordion";
|
|
|
|
function Sidebar({
|
|
items,
|
|
selectedScript,
|
|
setSelectedScript,
|
|
}: {
|
|
items: Category[];
|
|
selectedScript: string | null;
|
|
setSelectedScript: (script: string | null) => void;
|
|
}) {
|
|
const uniqueScripts = items.reduce((acc, category) => {
|
|
for (const script of category.scripts) {
|
|
if (!acc.some(s => s.name === script.name)) {
|
|
acc.push(script);
|
|
}
|
|
}
|
|
return acc;
|
|
}, [] as Script[]);
|
|
|
|
return (
|
|
<div className="flex min-w-[350px] flex-col sm:max-w-[350px]">
|
|
<div className="flex items-end justify-between pb-4">
|
|
<h1 className="text-xl font-bold">Categories</h1>
|
|
<p className="text-xs italic text-muted-foreground">
|
|
{uniqueScripts.length}
|
|
{" "}
|
|
Total scripts
|
|
</p>
|
|
</div>
|
|
<div className="rounded-lg">
|
|
<ScriptAccordion
|
|
items={items}
|
|
selectedScript={selectedScript}
|
|
setSelectedScript={setSelectedScript}
|
|
/>
|
|
</div>
|
|
</div>
|
|
);
|
|
}
|
|
|
|
export default Sidebar;
|