2024-02-28 00:39:05 +03:00
|
|
|
import Logo from "../Logo";
|
|
|
|
|
import { navbarLinks } from "@/pages/site-navigation";
|
|
|
|
|
import NavItem from "./NavItem";
|
2024-03-05 02:18:30 +03:00
|
|
|
import { CameraGroupSelector } from "../filter/CameraGroupSelector";
|
|
|
|
|
import { useLocation } from "react-router-dom";
|
2024-04-01 18:31:31 +03:00
|
|
|
import GeneralSettings from "../settings/GeneralSettings";
|
|
|
|
|
import AccountSettings from "../settings/AccountSettings";
|
2024-02-28 00:39:05 +03:00
|
|
|
|
|
|
|
|
function Sidebar() {
|
2024-03-05 02:18:30 +03:00
|
|
|
const location = useLocation();
|
|
|
|
|
|
2024-02-28 00:39:05 +03:00
|
|
|
return (
|
2024-04-10 01:49:14 +03:00
|
|
|
<aside className="absolute w-[52px] z-10 left-o inset-y-0 overflow-y-auto scrollbar-hidden py-4 flex flex-col justify-between bg-background_alt border-r border-secondary-highlight">
|
2024-02-28 00:39:05 +03:00
|
|
|
<span tabIndex={0} className="sr-only" />
|
|
|
|
|
<div className="w-full flex flex-col gap-0 items-center">
|
|
|
|
|
<Logo className="w-8 h-8 mb-6" />
|
2024-03-06 03:39:37 +03:00
|
|
|
{navbarLinks.map((item) => {
|
|
|
|
|
const showCameraGroups =
|
|
|
|
|
item.id == 1 && item.url == location.pathname;
|
|
|
|
|
|
|
|
|
|
return (
|
|
|
|
|
<div key={item.id}>
|
|
|
|
|
<NavItem
|
|
|
|
|
className={`mx-[10px] ${showCameraGroups ? "mb-2" : "mb-4"}`}
|
|
|
|
|
Icon={item.icon}
|
|
|
|
|
title={item.title}
|
|
|
|
|
url={item.url}
|
|
|
|
|
dev={item.dev}
|
|
|
|
|
/>
|
|
|
|
|
{showCameraGroups && <CameraGroupSelector className="mb-4" />}
|
|
|
|
|
</div>
|
|
|
|
|
);
|
|
|
|
|
})}
|
2024-02-28 00:39:05 +03:00
|
|
|
</div>
|
2024-04-01 18:31:31 +03:00
|
|
|
<div className="flex flex-col items-center mb-8">
|
|
|
|
|
<GeneralSettings />
|
|
|
|
|
<AccountSettings />
|
|
|
|
|
</div>
|
2024-02-28 00:39:05 +03:00
|
|
|
</aside>
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
export default Sidebar;
|