'use client' import Link from 'next/link' import { usePathname } from 'next/navigation' import { cva } from 'class-variance-authority' import { cn } from '@/lib/utils' import UserPanel from '@/components/user-panel' export interface SidebarProps { children: React.ReactNode className?: string } export default function Sidebar({ children, className }: SidebarProps) { return (
{children}
) } interface SidebarButtonProps { href: string children: React.ReactNode } const linkVariants = cva( 'flex items-center gap-3 rounded-lg px-3 py-2 text-zinc-900 transition-all hover:text-zinc-900 dark:text-zinc-50 dark:hover:text-zinc-50', { variants: { state: { selected: 'bg-zinc-200 dark:bg-zinc-800', 'not-selected': '' } }, defaultVariants: { state: 'not-selected' } } ) function SidebarButton({ href, children }: SidebarButtonProps) { const pathname = usePathname() const state = pathname == href ? 'selected' : 'not-selected' return ( {children} ) }