"use client";

import { usePathname } from "next/navigation";
import type { ReactNode } from "react";

export function ConditionalShell({
  children,
  show,
}: {
  children: ReactNode;
  show: "shop" | "admin";
}) {
  const pathname = usePathname();
  const isAdmin = pathname.startsWith("/admin");

  if (show === "shop" && isAdmin) return null;
  if (show === "admin" && !isAdmin) return null;

  return <>{children}</>;
}
