import { jsx as e, jsxs as r } from "react/jsx-runtime";
import { AlertTriangle as o } from "lucide-react";
import { Alert as x, AlertDescription as h } from "../atoms/alert.js";
import { Card as f, CardHeader as p, CardTitle as u, CardDescription as w, CardContent as N, CardFooter as v } from "../atoms/card.js";
import { cn as g } from "../../../lib/utils.js";
function A({
  title: i = "Something went wrong",
  description: l = "We've been notified of this error and will investigate.",
  errorMessage: t,
  errorStack: a,
  showDeveloperDetails: n = !1,
  children: s,
  className: d,
  ...m
}) {
  const c = !!(a && n);
  return /* @__PURE__ */ e(
    "div",
    {
      className: g("flex h-full items-center justify-center p-4", d),
      ...m,
      children: /* @__PURE__ */ r(f, { className: "w-full max-w-md 2xl:max-w-xl", role: "alert", children: [
        /* @__PURE__ */ r(p, { className: "text-center", children: [
          /* @__PURE__ */ e("div", { className: "mx-auto mb-4 flex h-12 w-12 items-center justify-center rounded-full bg-red-100 dark:bg-red-900/20", children: /* @__PURE__ */ e(o, { className: "h-6 w-6 text-red-600 dark:text-red-400" }) }),
          /* @__PURE__ */ e(u, { className: "text-xl", children: i }),
          l && /* @__PURE__ */ e(w, { children: l })
        ] }),
        (t || a) && /* @__PURE__ */ r(N, { className: "space-y-4", children: [
          t && /* @__PURE__ */ r(x, { variant: "destructive", children: [
            /* @__PURE__ */ e(o, { className: "h-4 w-4" }),
            /* @__PURE__ */ e(h, { className: "whitespace-pre-wrap break-words font-mono text-sm", children: t })
          ] }),
          c && /* @__PURE__ */ r("details", { className: "text-muted-foreground text-xs", children: [
            /* @__PURE__ */ e("summary", { className: "cursor-pointer hover:text-foreground", children: "Developer Details" }),
            /* @__PURE__ */ e("pre", { className: "mt-2 overflow-auto whitespace-pre-wrap rounded bg-muted p-2 text-xs", children: a })
          ] })
        ] }),
        s && /* @__PURE__ */ e(v, { className: "flex gap-2", children: s })
      ] })
    }
  );
}
export {
  A as ErrorState
};
