"use client";
'use strict';

var clsx = require('clsx');
var tailwindMerge = require('tailwind-merge');
var jsxRuntime = require('react/jsx-runtime');

function cn(...inputs) {
  return tailwindMerge.twMerge(clsx.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__ */ jsxRuntime.jsx("div", { className: "flex min-h-0 min-w-0 flex-1 flex-col pb-2", children: /* @__PURE__ */ jsxRuntime.jsx("div", { className: "min-h-0 min-w-0 flex-1 overflow-auto overscroll-contain", children }) });
  if (paginationPlacement === "bottom") {
    return /* @__PURE__ */ jsxRuntime.jsx(
      "div",
      {
        className: cn(
          "flex w-full min-w-0 flex-col gap-[2px]",
          fitContent ? "shrink-0" : "min-h-0",
          className
        ),
        children: /* @__PURE__ */ jsxRuntime.jsx("div", { className: cardShellClass, children: /* @__PURE__ */ jsxRuntime.jsxs(
          "div",
          {
            className: cn(
              "flex min-w-0 flex-col pb-0",
              fitContent ? "shrink-0" : "min-h-0 flex-1"
            ),
            children: [
              /* @__PURE__ */ jsxRuntime.jsx("div", { className: scrollRegionClass, children }),
              /* @__PURE__ */ jsxRuntime.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__ */ jsxRuntime.jsxs(
    "div",
    {
      className: cn(
        "flex min-h-0 min-w-0 w-full flex-col gap-[2px]",
        className
      ),
      children: [
        /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex min-w-0 shrink-0 justify-end", children: pagination }),
        /* @__PURE__ */ jsxRuntime.jsx("div", { className: cardShellClass, children: cardBody })
      ]
    }
  );
}

exports.SimpleInventoryTableShell = SimpleInventoryTableShell;
//# sourceMappingURL=simple-inventory-table-shell.cjs.map
//# sourceMappingURL=simple-inventory-table-shell.cjs.map