"use client";
import * as React from 'react';
import { jsx, jsxs } from 'react/jsx-runtime';
import { clsx } from 'clsx';
import { twMerge } from 'tailwind-merge';

var AppThemeContext = React.createContext(null);
function useTheme() {
  const context = React.useContext(AppThemeContext);
  if (context == null) {
    throw new Error("useTheme must be used within AppThemeProvider");
  }
  return context;
}
function cn(...inputs) {
  return twMerge(clsx(inputs));
}
function SimpleInventoryTableShell({
  pagination,
  children,
  className,
  paginationPlacement = "top",
  surface,
  cardBorderClassName = "border-border",
  fitContent = false
}) {
  const cardSurfaceClass = surface === "light" ? "bg-card" : surface === "dark" ? "bg-sidebar" : "bg-card";
  const cardShellClass = cn(
    "flex min-w-0 flex-col overflow-hidden rounded-[var(--radius-sm)] border",
    fitContent ? "w-full shrink-0" : "min-h-0 flex-1",
    cardBorderClassName,
    cardSurfaceClass
  );
  const scrollRegionClass = fitContent ? "min-w-0 overflow-x-auto" : "min-h-0 min-w-0 flex-1 overflow-auto overscroll-contain";
  const cardBody = /* @__PURE__ */ jsx("div", { className: "flex min-h-0 min-w-0 flex-1 flex-col pb-2", children: /* @__PURE__ */ jsx("div", { className: "min-h-0 min-w-0 flex-1 overflow-auto overscroll-contain", children }) });
  if (paginationPlacement === "bottom") {
    return /* @__PURE__ */ jsx(
      "div",
      {
        className: cn(
          "flex w-full min-w-0 flex-col gap-[2px]",
          fitContent ? "shrink-0" : "min-h-0",
          className
        ),
        children: /* @__PURE__ */ jsx("div", { className: cardShellClass, children: /* @__PURE__ */ jsxs(
          "div",
          {
            className: cn(
              "flex min-w-0 flex-col pb-0",
              fitContent ? "shrink-0" : "min-h-0 flex-1"
            ),
            children: [
              /* @__PURE__ */ jsx("div", { className: scrollRegionClass, children }),
              /* @__PURE__ */ jsx(
                "div",
                {
                  className: cn(
                    "flex h-10 min-h-10 max-h-10 min-w-0 shrink-0 items-center justify-end border-t border-solid border-border px-2",
                    cardSurfaceClass
                  ),
                  children: pagination
                }
              )
            ]
          }
        ) })
      }
    );
  }
  return /* @__PURE__ */ jsxs(
    "div",
    {
      className: cn(
        "flex min-h-0 min-w-0 w-full flex-col gap-[2px]",
        className
      ),
      children: [
        /* @__PURE__ */ jsx("div", { className: "flex min-w-0 shrink-0 justify-end", children: pagination }),
        /* @__PURE__ */ jsx("div", { className: cardShellClass, children: cardBody })
      ]
    }
  );
}
function DesignSystemTableShellNoTabs({
  pagination,
  children,
  className,
  cardBorderClassName,
  fitContent
}) {
  const { resolvedTheme } = useTheme();
  const surface = resolvedTheme === "dark" ? "dark" : "light";
  return /* @__PURE__ */ jsx(
    SimpleInventoryTableShell,
    {
      className,
      paginationPlacement: "bottom",
      surface,
      cardBorderClassName,
      fitContent,
      pagination,
      children
    }
  );
}

export { DesignSystemTableShellNoTabs };
//# sourceMappingURL=design-system-table-shell-no-tabs.js.map
//# sourceMappingURL=design-system-table-shell-no-tabs.js.map