"use client";
import { cn } from "@/lib/utils";
import { BookOpenText, Home, Search, SquarePen, Settings, Newspaper } from "lucide-react";
import Link from "next/link";
import { useSelectedLayoutSegments } from "next/navigation";
import React, { useState, type ReactNode } from "react";
import Layout from "./Layout";
import SettingsDialog from "./SettingsDialog";
const VerticalIconContainer = ({ children }: { children: ReactNode }) => {
return
{children}
;
};
const Sidebar = ({ children }: { children: React.ReactNode }) => {
const segments = useSelectedLayoutSegments();
const [isSettingsOpen, setIsSettingsOpen] = useState(false);
const navLinks = [
{
icon: Home,
href: "/",
active: segments.length === 0 || segments.includes("c"),
label: "Home",
},
{
icon: Search,
href: "/discover",
active: segments.includes("discover"),
label: "Discover",
},
{
icon: BookOpenText,
href: "/library",
active: segments.includes("library"),
label: "Library",
},
{
icon: Newspaper,
href: "/news",
active: segments.includes("news"),
label: "News",
},
];
return (
{navLinks.map((link, index) => (
{link.active && (
)}
))}
setIsSettingsOpen(!isSettingsOpen)} className="cursor-pointer" />
{navLinks.map((link, index) => (
{link.active &&
}
{link.label}
))}
{children}
);
};
export default Sidebar;