'use client';

import { usePathname } from 'next/navigation';

// Public site chrome (header / footer / cart drawer) is hidden anywhere under
// /admin, which has its own minimal top bar instead.
export function HideOnAdmin({ children }: { children: React.ReactNode }) {
  const pathname = usePathname();
  const isAdmin = pathname?.split('/').includes('admin') ?? false;
  if (isAdmin) return null;
  return <>{children}</>;
}