"use client";

// src/lib/utils.ts
import { clsx } from "clsx";
import { twMerge } from "tailwind-merge";
function cn(...inputs) {
  return twMerge(clsx(inputs));
}

// src/components/ui/list-page-view-frame.tsx
import { jsx } from "react/jsx-runtime";
var LIST_PAGE_VIEW_FRAME_GUTTER = "mx-4 mb-6 lg:mx-6";
var LIST_PAGE_VIEW_FRAME_MAX_ICON_GRID = "max-w-6xl";
function ListPageViewFrame({
  children,
  className,
  maxWidthClassName,
  gutterClassName = LIST_PAGE_VIEW_FRAME_GUTTER,
  ...rest
}) {
  return /* @__PURE__ */ jsx("div", { className: cn(gutterClassName, className), ...rest, children: maxWidthClassName ? /* @__PURE__ */ jsx("div", { className: cn("mx-auto w-full min-w-0", maxWidthClassName), children }) : children });
}

// src/components/data-views/folder-grid-view.tsx
import { Fragment, jsx as jsx2, jsxs } from "react/jsx-runtime";
function FolderGridTile({
  row,
  renderTile
}) {
  return /* @__PURE__ */ jsx2(Fragment, { children: renderTile(row) });
}
function FolderGridView({
  rows,
  getRowId,
  renderTile,
  emptyContent,
  ariaLabel = "Folder view",
  className,
  constrainWidth = false
}) {
  if (rows.length === 0) {
    return /* @__PURE__ */ jsx2(
      ListPageViewFrame,
      {
        maxWidthClassName: constrainWidth ? LIST_PAGE_VIEW_FRAME_MAX_ICON_GRID : void 0,
        className: cn(className),
        children: /* @__PURE__ */ jsxs("div", { className: "flex flex-col items-center justify-center rounded-xl border border-dashed border-border py-16 text-sm text-muted-foreground", children: [
          /* @__PURE__ */ jsx2("i", { className: "fa-solid fa-grid-2 mb-3 text-3xl opacity-40", "aria-hidden": "true" }),
          emptyContent ?? /* @__PURE__ */ jsx2("p", { children: "No records found." })
        ] })
      }
    );
  }
  return /* @__PURE__ */ jsx2(ListPageViewFrame, { className: cn(className), children: /* @__PURE__ */ jsx2(
    "ul",
    {
      className: cn(
        "m-0 grid list-none grid-cols-2 gap-3 p-0 sm:grid-cols-3 md:grid-cols-4 lg:grid-cols-5 xl:grid-cols-6 2xl:grid-cols-8",
        constrainWidth && "mx-auto max-w-6xl"
      ),
      "aria-label": ariaLabel,
      children: rows.map((row) => /* @__PURE__ */ jsx2("li", { children: /* @__PURE__ */ jsx2(FolderGridTile, { row, renderTile }) }, getRowId(row)))
    }
  ) });
}
export {
  FolderGridView
};
//# sourceMappingURL=folder-grid-view.js.map