'use client' import { Home, Warehouse, Package } from 'lucide-react' import Link from 'next/link' import { usePathname } from 'next/navigation' import { AuthGuard } from '@/components/auth-guard' import { Sidebar } from '@/components/dashboard/sidebar' import { useRoleGuard } from '@/hooks/useRoleGuard' import { useSidebar } from '@/hooks/useSidebar' // Компонент Breadcrumbs function Breadcrumbs({ pathname }: { pathname: string }) { const segments = pathname.split('/').filter(Boolean) const breadcrumbs = [{ name: 'Главная', href: '/seller/home', icon: Home }] if (segments[0] === 'seller' && segments[1] === 'warehouse') { breadcrumbs.push({ name: 'Склад', href: '/seller/warehouse', icon: Warehouse }) if (segments[2]) { const sectionMap: Record = { fulfillment: 'Склад фулфилмент', wildberries: 'Склад Wildberries', storage: 'Мой склад', } const section = sectionMap[segments[2]] if (section) { breadcrumbs.push({ name: section, href: `/seller/warehouse/${segments[2]}`, icon: Package, }) } } } return ( ) } export default function SellerWarehouseLayout({ children }: { children: React.ReactNode }) { useRoleGuard('SELLER') const { getSidebarMargin } = useSidebar() const pathname = usePathname() // Определяем активный таб const getActiveTab = () => { if (pathname.includes('/fulfillment')) return 'fulfillment' if (pathname.includes('/wildberries')) return 'wildberries' if (pathname.includes('/storage')) return 'storage' return 'fulfillment' // default } const activeTab = getActiveTab() return (
{/* Breadcrumbs */} {/* Табы навигация - точно как в WBWarehouseDashboard */}
Склад фулфилмент Склад Wildberries Мой склад
{/* Контент страницы */}
{children}
) }