2026-08-30 05:24:48 +00:00
|
|
|
import { useState } from "react";
|
|
|
|
|
import { EpisodesIcon, FilterIcon, ListIcon, PaletteIcon, RenameIcon, SfvIcon, SubtitlesIcon } from "./Icons";
|
|
|
|
|
import SettingsModal from "./SettingsModal";
|
2026-08-29 01:55:54 +00:00
|
|
|
|
|
|
|
|
export interface PanelDef {
|
|
|
|
|
id: string;
|
|
|
|
|
name: string;
|
|
|
|
|
icon: () => JSX.Element;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// Same panel set, same order, as the original's PanelBuilder.defaultSequence().
|
|
|
|
|
export const PANELS: PanelDef[] = [
|
|
|
|
|
{ id: "rename", name: "Rename", icon: RenameIcon },
|
|
|
|
|
{ id: "episodes", name: "Episodes", icon: EpisodesIcon },
|
|
|
|
|
{ id: "subtitles", name: "Subtitles", icon: SubtitlesIcon },
|
|
|
|
|
{ id: "sfv", name: "SFV", icon: SfvIcon },
|
|
|
|
|
{ id: "filter", name: "Filter", icon: FilterIcon },
|
|
|
|
|
{ id: "list", name: "List", icon: ListIcon },
|
|
|
|
|
];
|
|
|
|
|
|
|
|
|
|
const APP_VERSION = "0.1.0";
|
|
|
|
|
|
|
|
|
|
export default function Sidebar({
|
|
|
|
|
selected,
|
|
|
|
|
onSelect,
|
|
|
|
|
}: {
|
|
|
|
|
selected: string;
|
|
|
|
|
onSelect: (id: string) => void;
|
|
|
|
|
}) {
|
2026-08-30 05:24:48 +00:00
|
|
|
const [settingsOpen, setSettingsOpen] = useState(false);
|
|
|
|
|
|
2026-08-29 01:55:54 +00:00
|
|
|
return (
|
|
|
|
|
<nav className="sidebar">
|
|
|
|
|
<ul className="sidebar-list">
|
|
|
|
|
{PANELS.map((panel) => {
|
|
|
|
|
const Icon = panel.icon;
|
|
|
|
|
const isSelected = panel.id === selected;
|
|
|
|
|
return (
|
|
|
|
|
<li key={panel.id}>
|
|
|
|
|
<button
|
|
|
|
|
className={`sidebar-item${isSelected ? " selected" : ""}`}
|
|
|
|
|
onClick={() => onSelect(panel.id)}
|
|
|
|
|
>
|
|
|
|
|
{isSelected && <span className="sidebar-item-accent" />}
|
|
|
|
|
<Icon />
|
|
|
|
|
<span>{panel.name}</span>
|
|
|
|
|
</button>
|
|
|
|
|
</li>
|
|
|
|
|
);
|
|
|
|
|
})}
|
|
|
|
|
</ul>
|
|
|
|
|
|
|
|
|
|
<div className="sidebar-footer">
|
2026-08-30 05:24:48 +00:00
|
|
|
<button
|
|
|
|
|
className="sidebar-settings-button"
|
|
|
|
|
title="Settings (theme)"
|
|
|
|
|
onClick={() => setSettingsOpen(true)}
|
|
|
|
|
>
|
|
|
|
|
<PaletteIcon />
|
|
|
|
|
</button>
|
2026-08-29 10:07:09 +00:00
|
|
|
<span className="sidebar-wordmark">Aurora Curator</span>
|
2026-08-29 01:55:54 +00:00
|
|
|
<span className="sidebar-version">v{APP_VERSION}</span>
|
|
|
|
|
</div>
|
2026-08-30 05:24:48 +00:00
|
|
|
|
|
|
|
|
<SettingsModal open={settingsOpen} onClose={() => setSettingsOpen(false)} />
|
2026-08-29 01:55:54 +00:00
|
|
|
</nav>
|
|
|
|
|
);
|
|
|
|
|
}
|