import { Fragment, jsx, jsxs } from "react/jsx-runtime";
import { Card, CardContent, CardHeader } from "./card.js";
import { Skeleton } from "./skeleton.js";
function SkeletonFormHeader() {
  return /* @__PURE__ */ jsx("div", { className: "flex items-center mb-8", children: /* @__PURE__ */ jsxs("div", { className: "flex items-center space-x-4", children: [
    /* @__PURE__ */ jsx(Skeleton, { className: "h-12 w-12 rounded-lg" }),
    /* @__PURE__ */ jsxs("div", { className: "space-y-2", children: [
      /* @__PURE__ */ jsx(Skeleton, { className: "h-8 w-64" }),
      /* @__PURE__ */ jsxs("div", { className: "flex items-center space-x-2", children: [
        /* @__PURE__ */ jsx(Skeleton, { className: "h-4 w-20" }),
        /* @__PURE__ */ jsx(Skeleton, { className: "h-4 w-4" }),
        /* @__PURE__ */ jsx(Skeleton, { className: "h-4 w-32" })
      ] })
    ] })
  ] }) });
}
function SkeletonFormFieldGroup({ fieldCount = 2 }) {
  return /* @__PURE__ */ jsx("div", { className: "grid grid-cols-1 md:grid-cols-2 gap-6", children: Array.from({ length: fieldCount }).map((_, index) => /* @__PURE__ */ jsxs("div", { className: "space-y-2", children: [
    /* @__PURE__ */ jsx(Skeleton, { className: "h-4 w-24" }),
    /* @__PURE__ */ jsx(Skeleton, { className: "h-10 w-full" })
  ] }, index)) });
}
function SkeletonFormField({ isTextarea = false }) {
  return /* @__PURE__ */ jsxs("div", { className: "space-y-2", children: [
    /* @__PURE__ */ jsx(Skeleton, { className: "h-4 w-32" }),
    /* @__PURE__ */ jsx(Skeleton, { className: `${isTextarea ? "h-24" : "h-10"} w-full` })
  ] });
}
function SkeletonFormJsonField() {
  return /* @__PURE__ */ jsxs("div", { className: "space-y-2", children: [
    /* @__PURE__ */ jsx(Skeleton, { className: "h-4 w-28" }),
    /* @__PURE__ */ jsxs("div", { className: "space-y-1", children: [
      /* @__PURE__ */ jsx(Skeleton, { className: "h-10 w-full" }),
      /* @__PURE__ */ jsx(Skeleton, { className: "h-8 w-3/4" }),
      /* @__PURE__ */ jsx(Skeleton, { className: "h-8 w-5/6" }),
      /* @__PURE__ */ jsx(Skeleton, { className: "h-8 w-2/3" })
    ] })
  ] });
}
function SkeletonFormCard({
  fieldCount = 6,
  hasTextareas = true,
  hasJsonFields = true
}) {
  return /* @__PURE__ */ jsxs(Card, { children: [
    /* @__PURE__ */ jsx(CardHeader, { children: /* @__PURE__ */ jsxs("div", { className: "space-y-2", children: [
      /* @__PURE__ */ jsx(Skeleton, { className: "h-6 w-32" }),
      /* @__PURE__ */ jsx(Skeleton, { className: "h-4 w-64" })
    ] }) }),
    /* @__PURE__ */ jsxs(CardContent, { className: "space-y-6", children: [
      /* @__PURE__ */ jsx(SkeletonFormFieldGroup, { fieldCount: 2 }),
      hasTextareas && /* @__PURE__ */ jsxs(Fragment, { children: [
        /* @__PURE__ */ jsx(SkeletonFormField, { isTextarea: true }),
        /* @__PURE__ */ jsx(SkeletonFormField, { isTextarea: true })
      ] }),
      /* @__PURE__ */ jsx(SkeletonFormFieldGroup, { fieldCount: 2 }),
      hasJsonFields && /* @__PURE__ */ jsxs(Fragment, { children: [
        /* @__PURE__ */ jsx(SkeletonFormJsonField, {}),
        /* @__PURE__ */ jsx(SkeletonFormFieldGroup, { fieldCount: 2 })
      ] }),
      fieldCount > 6 && /* @__PURE__ */ jsx(SkeletonFormFieldGroup, { fieldCount: Math.min(fieldCount - 6, 4) })
    ] })
  ] });
}
function SkeletonFormActions() {
  return /* @__PURE__ */ jsxs("div", { className: "flex items-center justify-between pt-6 border-t", children: [
    /* @__PURE__ */ jsx(Skeleton, { className: "h-10 w-24" }),
    /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-3", children: [
      /* @__PURE__ */ jsx(Skeleton, { className: "h-10 w-20" }),
      /* @__PURE__ */ jsx(Skeleton, { className: "h-10 w-32" })
    ] })
  ] });
}
function SkeletonEntityForm({
  fieldCount = 8,
  hasTextareas = true,
  hasJsonFields = true
}) {
  return /* @__PURE__ */ jsx("div", { className: "p-6", children: /* @__PURE__ */ jsxs("div", { className: "max-w-7xl mx-auto space-y-6", children: [
    /* @__PURE__ */ jsx(SkeletonFormHeader, {}),
    /* @__PURE__ */ jsxs("div", { className: "space-y-6", children: [
      /* @__PURE__ */ jsx(
        SkeletonFormCard,
        {
          fieldCount,
          hasTextareas,
          hasJsonFields
        }
      ),
      /* @__PURE__ */ jsx(SkeletonFormActions, {})
    ] })
  ] }) });
}
export {
  SkeletonEntityForm,
  SkeletonFormActions,
  SkeletonFormCard,
  SkeletonFormField,
  SkeletonFormFieldGroup,
  SkeletonFormHeader,
  SkeletonFormJsonField
};
