Refactor Channel Manager sidebar
This commit is contained in:
@@ -63,6 +63,14 @@ const DashboardLayout = ({ children }: { children: React.ReactNode }) => {
|
||||
{ icon: MessageSquare, label: 'Message', path: '/dashboard/messages', badge: '2' },
|
||||
];
|
||||
|
||||
const channelManagerSubmenu = [
|
||||
{ icon: BarChart3, label: 'Resumen', tab: 'overview' },
|
||||
{ icon: Zap, label: 'Canales', tab: 'channels' },
|
||||
{ icon: Home, label: 'Propiedades', tab: 'listings' },
|
||||
{ icon: BookOpen, label: 'Reservas', tab: 'reservations' },
|
||||
{ icon: BarChart3, label: 'Analytics', tab: 'analytics' },
|
||||
];
|
||||
|
||||
const adminSubmenu = [
|
||||
{ icon: BarChart3, label: 'Resumen General', tab: 'overview' },
|
||||
{ icon: Users, label: 'Gestión de Usuarios', tab: 'users' },
|
||||
@@ -156,6 +164,7 @@ const DashboardLayout = ({ children }: { children: React.ReactNode }) => {
|
||||
const Icon = item.icon;
|
||||
const isActive = location.pathname === item.path;
|
||||
const isAdminPanel = item.path === '/dashboard/admin';
|
||||
const isChannelManager = item.path === '/dashboard/channel-manager';
|
||||
|
||||
return (
|
||||
<div key={item.path}>
|
||||
@@ -185,6 +194,27 @@ const DashboardLayout = ({ children }: { children: React.ReactNode }) => {
|
||||
)}
|
||||
</Link>
|
||||
|
||||
{/* Channel Manager submenus */}
|
||||
{!sidebarCollapsed && isChannelManager && location.pathname.startsWith('/dashboard/channel-manager') && (
|
||||
<div className="mt-1 ml-10 space-y-1">
|
||||
{channelManagerSubmenu.map((sub) => {
|
||||
const SubIcon = sub.icon;
|
||||
const activeSub = currentTab === sub.tab;
|
||||
|
||||
return (
|
||||
<Link
|
||||
key={sub.tab}
|
||||
to={`/dashboard/channel-manager?tab=${sub.tab}`}
|
||||
className={`flex items-center space-x-2 px-3 py-2 rounded-md text-sm ${activeSub ? 'bg-orange-50 text-orange-800' : 'text-gray-600 hover:text-orange-600 hover:bg-gray-50'}`}
|
||||
>
|
||||
<SubIcon className="w-4 h-4" />
|
||||
<span>{sub.label}</span>
|
||||
</Link>
|
||||
);
|
||||
})}
|
||||
</div>
|
||||
)}
|
||||
|
||||
{/* Admin submenus */}
|
||||
{!sidebarCollapsed && isAdminPanel && location.pathname.startsWith('/dashboard/admin') && (
|
||||
<div className="mt-1 ml-10 space-y-1">
|
||||
|
||||
Reference in New Issue
Block a user