"use client";
import { jsx, jsxs } from "react/jsx-runtime";
import { Card, CardContent } from "./card";
import { Skeleton } from "./skeleton";
function SkeletonListHeader() {
  return /* @__PURE__ */ jsxs("div", { className: "flex items-center justify-between mb-8", children: [
    /* @__PURE__ */ jsxs("div", { className: "space-y-2", children: [
      /* @__PURE__ */ jsx(Skeleton, { className: "h-10 w-32" }),
      /* @__PURE__ */ jsx(Skeleton, { className: "h-5 w-48" })
    ] }),
    /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-4", children: [
      /* @__PURE__ */ jsx(Skeleton, { className: "h-10 w-80" }),
      /* @__PURE__ */ jsx(Skeleton, { className: "h-10 w-32" })
    ] })
  ] });
}
function SkeletonTableHeader({ columnCount = 6 }) {
  return /* @__PURE__ */ jsx("thead", { className: "border-b bg-muted/50", children: /* @__PURE__ */ jsxs("tr", { children: [
    /* @__PURE__ */ jsx("th", { className: "w-12 px-4 py-3", children: /* @__PURE__ */ jsx(Skeleton, { className: "h-4 w-4" }) }),
    Array.from({ length: columnCount }).map((_, index) => /* @__PURE__ */ jsx("th", { className: "px-4 py-3 text-left", children: /* @__PURE__ */ jsx(Skeleton, { className: "h-4 w-24" }) }, index)),
    /* @__PURE__ */ jsx("th", { className: "w-16 px-4 py-3", children: /* @__PURE__ */ jsx(Skeleton, { className: "h-4 w-16" }) })
  ] }) });
}
function SkeletonTableRow({ columnCount = 6 }) {
  return /* @__PURE__ */ jsxs("tr", { className: "border-b hover:bg-muted/50", children: [
    /* @__PURE__ */ jsx("td", { className: "w-12 px-4 py-3", children: /* @__PURE__ */ jsx(Skeleton, { className: "h-4 w-4" }) }),
    Array.from({ length: columnCount }).map((_, index) => /* @__PURE__ */ jsx("td", { className: "px-4 py-3", children: /* @__PURE__ */ jsx(Skeleton, { className: `h-4 ${index === 0 ? "w-40" : (
      // First column (name) - wider
      index === 1 ? "w-32" : (
        // Second column (category/type) - medium
        index === 2 ? "w-48" : (
          // Third column (url/email) - wider
          index === 3 ? "w-24" : (
            // Fourth column (status/short) - narrow
            index === 4 ? "w-28" : (
              // Fifth column (medium)
              "w-36"
            )
          )
        )
      )
    )}` }) }, index)),
    /* @__PURE__ */ jsx("td", { className: "w-16 px-4 py-3", children: /* @__PURE__ */ jsx(Skeleton, { className: "h-6 w-6 rounded" }) })
  ] });
}
function SkeletonTable({
  rowCount = 8,
  columnCount = 6
}) {
  return /* @__PURE__ */ jsx(Card, { children: /* @__PURE__ */ jsx("div", { className: "overflow-x-auto", children: /* @__PURE__ */ jsxs("table", { className: "w-full", children: [
    /* @__PURE__ */ jsx(SkeletonTableHeader, { columnCount }),
    /* @__PURE__ */ jsx("tbody", { children: Array.from({ length: rowCount }).map((_, index) => /* @__PURE__ */ jsx(SkeletonTableRow, { columnCount }, index)) })
  ] }) }) });
}
function SkeletonPagination() {
  return /* @__PURE__ */ jsxs("div", { className: "flex items-center justify-between mt-6", children: [
    /* @__PURE__ */ jsx(Skeleton, { className: "h-4 w-48" }),
    /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2", children: [
      /* @__PURE__ */ jsx(Skeleton, { className: "h-8 w-20" }),
      /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-1", children: [
        /* @__PURE__ */ jsx(Skeleton, { className: "h-8 w-8" }),
        /* @__PURE__ */ jsx(Skeleton, { className: "h-8 w-8" }),
        /* @__PURE__ */ jsx(Skeleton, { className: "h-8 w-8" }),
        /* @__PURE__ */ jsx(Skeleton, { className: "h-8 w-8" })
      ] }),
      /* @__PURE__ */ jsx(Skeleton, { className: "h-8 w-20" })
    ] })
  ] });
}
function SkeletonBulkActions() {
  return /* @__PURE__ */ jsx(Card, { className: "mb-4", children: /* @__PURE__ */ jsx(CardContent, { className: "py-3", children: /* @__PURE__ */ jsxs("div", { className: "flex items-center justify-between", children: [
    /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-3", children: [
      /* @__PURE__ */ jsx(Skeleton, { className: "h-4 w-32" }),
      /* @__PURE__ */ jsx(Skeleton, { className: "h-8 w-20" })
    ] }),
    /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2", children: [
      /* @__PURE__ */ jsx(Skeleton, { className: "h-8 w-24" }),
      /* @__PURE__ */ jsx(Skeleton, { className: "h-8 w-20" })
    ] })
  ] }) }) });
}
function SkeletonEntityList({
  rowCount = 8,
  columnCount = 6,
  showBulkActions = false
}) {
  return /* @__PURE__ */ jsxs("div", { className: "p-6 space-y-6", children: [
    /* @__PURE__ */ jsx(SkeletonListHeader, {}),
    showBulkActions && /* @__PURE__ */ jsx(SkeletonBulkActions, {}),
    /* @__PURE__ */ jsx(SkeletonTable, { rowCount, columnCount }),
    /* @__PURE__ */ jsx(SkeletonPagination, {})
  ] });
}
export {
  SkeletonBulkActions,
  SkeletonEntityList,
  SkeletonListHeader,
  SkeletonPagination,
  SkeletonTable,
  SkeletonTableHeader,
  SkeletonTableRow
};
