'use client'; import { cn } from '@/lib/utils'; import { BookOpenText, Home, Search, SquarePen } from 'lucide-react'; import { SiGithub } from '@icons-pack/react-simple-icons'; import Link from 'next/link'; import { useSelectedLayoutSegments } from 'next/navigation'; import React from 'react'; import Layout from './Layout'; const Sidebar = ({ children }: { children: React.ReactNode }) => { const segments = useSelectedLayoutSegments(); const navLinks = [ { icon: Home, href: '/', active: segments.length === 0, label: 'Home', }, { icon: Search, href: '/discover', active: segments.includes('discover'), label: 'Discover', }, { icon: BookOpenText, href: '/library', active: segments.includes('library'), label: 'Library', }, ]; return (
{navLinks.map((link, i) => ( {link.active && (
)} ))}
{navLinks.map((link, i) => ( {link.active && (
)}

{link.label}

))}
{children}
); }; export default Sidebar;