"use client"

import { usePathname } from "next/navigation"
import { AppSidebar } from "./app-sidebar"
import { StorefrontSidebar } from "./storefront-sidebar"

export function AdminSidebarWrapper({ user, onlineServerUrl, settings }: any) {
  const pathname = usePathname();
  const isStorefront = pathname?.startsWith("/admin/storefront");

  if (isStorefront) {
    return <StorefrontSidebar user={user} onlineServerUrl={onlineServerUrl} settings={settings} />
  }

  return <AppSidebar user={user} onlineServerUrl={onlineServerUrl} settings={settings} />
}
