"use client";
import { jsx } from "react/jsx-runtime";
import { cn } from "@open-mercato/shared/lib/utils";
const baseLine = "animate-pulse rounded-md bg-muted";
function Skeleton({
  shape = "rect",
  lines = 1,
  className,
  ...rest
}) {
  if (shape === "text") {
    const count = Math.max(1, lines);
    return /* @__PURE__ */ jsx(
      "div",
      {
        role: "status",
        "aria-busy": "true",
        "aria-live": "polite",
        className: cn("w-full space-y-2", className),
        "data-slot": "skeleton",
        ...rest,
        children: Array.from({ length: count }).map((_, index) => /* @__PURE__ */ jsx(
          "div",
          {
            className: cn(
              baseLine,
              "h-4",
              index === count - 1 && count > 1 ? "w-3/4" : "w-full"
            )
          },
          index
        ))
      }
    );
  }
  return /* @__PURE__ */ jsx(
    "div",
    {
      role: "status",
      "aria-busy": "true",
      "aria-live": "polite",
      "data-slot": "skeleton",
      className: cn(
        baseLine,
        shape === "circle" && "rounded-full",
        className
      ),
      ...rest
    }
  );
}
export {
  Skeleton
};
//# sourceMappingURL=skeleton.js.map
