import React from 'react';
import { Accordion, AccordionTab } from 'primereact/accordion';
import { useRouter } from 'next/router';
import 'primeicons/primeicons.css';
const Sidebar = () => {
const router = useRouter();
// Helper function to determine if the path matches the current route
const isActive = (path) => {
return router.pathname === path;
};
return (
router.push('/')} className={`w-full cursor-pointer hover:bg-gray-700 rounded-lg ${isActive('/') ? 'bg-gray-700' : ''}`}>
Home
router.push('/content')} className={`w-full cursor-pointer hover:bg-gray-700 rounded-lg ${isActive('/content') ? 'bg-gray-700' : ''}`}>
Content
({
className: 'border-none bg-transparent hover:bg-gray-700 rounded-lg',
}),
headerAction: ({ context }) => ({
className: 'border-none bg-transparent py-3 my-2',
}),
content: { className: 'border-none bg-transparent pt-0' }
}
}}
className="unstyled border-none bg-transparent">
router.push('/chat/general')} className={`w-full cursor-pointer hover:bg-gray-700 rounded-lg ${isActive('/chat/general') ? 'bg-gray-700' : ''}`}>
general
router.push('/chat/nostr')} className={`w-full cursor-pointer hover:bg-gray-700 rounded-lg ${isActive('/chat/nostr') ? 'bg-gray-700' : ''}`}>
nostr
router.push('/chat/discord')} className={`w-full cursor-pointer hover:bg-gray-700 rounded-lg ${isActive('/chat/discord') ? 'bg-gray-700' : ''}`}>
discord
router.push('/chat/stackernews')} className={`w-full cursor-pointer hover:bg-gray-700 rounded-lg ${isActive('/chat/stackernews') ? 'bg-gray-700' : ''}`}>
stackernews
);
};
export default Sidebar;