import { Link, Outlet, useLocation, useParams } from "@remix-run/react"; import { LayoutGrid, Package, ClipboardList, Wallet, Truck, MessageCircle, Settings, ArrowRight, } from "lucide-react"; import { useSellerData } from "~/requestHandler/use-seller-hooks"; import SellerLogo from "~/components/SellerLogo"; import { useBadgeCounts } from "~/hooks/useBadgeCounts"; /** * Desktop layout for the seller dashboard. Renders a sticky admin sidebar * next to the page content at lg+; on mobile it's just the page content * (the existing mobile dashboard, with its store-mode bottom nav, is unchanged). */ export default function StoreLayout() { const { storeId } = useParams(); const location = useLocation(); const { data } = useSellerData(storeId); const { data: badges } = useBadgeCounts(); const base = `/store/${storeId}`; const NAV = [ { label: "فروشگاه", to: base, icon: LayoutGrid, exact: true }, { label: "محصولات", to: `${base}/products`, icon: Package }, { label: "سفارشها", to: `${base}/orders`, icon: ClipboardList, badge: badges?.seller_orders || 0, }, { label: "مالی", to: `${base}/financial-dashboard`, icon: Wallet }, { label: "روش ارسال", to: `${base}/shipping-method`, icon: Truck }, { label: "پیامها", to: `${base}/threads`, icon: MessageCircle, badge: badges?.chat || 0, }, { label: "تنظیمات", to: `${base}/setting`, icon: Settings }, ]; const isActive = (item: { to: string; exact?: boolean }) => item.exact ? location.pathname === item.to : location.pathname.startsWith(item.to); return (